Releases: dvdoug/BoxPacker
Releases · dvdoug/BoxPacker
v4.0.1
v4.0.0
Added
- Added new enumeration
Rotation
with valuesNever
,KeepFlat
andBestFit
- Added new
getAllowedRotation()
method to theItem
interface to replacegetKeepFlat()
. This should return
one of the newRotation
enum values - Added new
generateVisualisationURL()
method toPackedBox
andPackedBoxList
. This will generate a custom URL for
a visualisation you can access via the BoxPacker website - Added new
packAllPermutations()
method toPacker
to calculate all possible box combinations - Added
throwOnUnpackableItem()
toPacker
to control if an exception is thrown (or not) if an unpackable item is
found (defaults to true, consistent with previous behaviour) - Added
getUnpackedItems()
toPacker
to retrieve the list of items that could not be packed (only applicable if
exceptions are disabled) PackedBox
now has readonly public properties->box
and->item
PackedItem
now has readonly public properties->item
,->x
,->y
,->z
,->width
,->length
,->depth
Changed
- Minimum PHP version is now 8.2
- Exceptions are now in the
DVDoug\BoxPacker\Exception
namespace (previouslyDVDoug\BoxPacker
) - The signature of the
->canBePacked
method on theConstrainedPlacementItem
interface has been changed to replace the
first two arguments(Box $box
,PackedItemList $alreadyPackedItems
) withPackedBox $packedBox
. This allows
callbacks to make use of the helper methods provided onPackedBox
. Access to the box and items can be done via
$packedBox->box
and$packedBox->items
NoBoxesAvailableException
now has a->getAffectedItems()
method instead of->getItem()
. This should allow
improved handling of the exception inside calling applications when multiple items cannot be packed
Removed
- Removed
getBox()
andgetItems()
fromPackedBox
. Use the new public properties instead - Removed
->getItem()
,->getX()
,->getY()
,->getZ()
,->getWidth()
,->getLength()
and->getDepth()
fromPackedItem
. Use the new public properties instead - Removed deprecated
ConstrainedItem
. You should useConstrainedPlacementItem
as a replacement - Removed
getKeepFlat()
from theItem
interface - Removed
InfalliblePacker
. You can now get the same behaviour by calling->throwOnUnpackableItem(false)
and
->getUnpackedItems()
on the mainPacker
class
v3.12.1
v3.12.0
v3.11.0
Changed
- Calling
json_encode()
on aPackedBox
orPackedItem
now additionally serialises the entire underlying
Box
/Item
where those objects also implementJsonSerializable
. Previously the serialisation only included the
key values from theBox
/Item
interfaces themselves.