Releases: dvdoug/BoxPacker
Releases · dvdoug/BoxPacker
v4.1.1
v4.1.0
v4.0.1
v4.0.0
Added
- Added new enumeration
Rotationwith valuesNever,KeepFlatandBestFit - Added new
getAllowedRotation()method to theIteminterface to replacegetKeepFlat(). This should return
one of the newRotationenum values - Added new
generateVisualisationURL()method toPackedBoxandPackedBoxList. This will generate a custom URL for
a visualisation you can access via the BoxPacker website - Added new
packAllPermutations()method toPackerto calculate all possible box combinations - Added
throwOnUnpackableItem()toPackerto control if an exception is thrown (or not) if an unpackable item is
found (defaults to true, consistent with previous behaviour) - Added
getUnpackedItems()toPackerto retrieve the list of items that could not be packed (only applicable if
exceptions are disabled) PackedBoxnow has readonly public properties->boxand->itemPackedItemnow 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\Exceptionnamespace (previouslyDVDoug\BoxPacker) - The signature of the
->canBePackedmethod on theConstrainedPlacementIteminterface 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->boxand$packedBox->items NoBoxesAvailableExceptionnow 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 useConstrainedPlacementItemas a replacement - Removed
getKeepFlat()from theIteminterface - Removed
InfalliblePacker. You can now get the same behaviour by calling->throwOnUnpackableItem(false)and
->getUnpackedItems()on the mainPackerclass
v3.12.1
v3.12.0
v3.11.0
Changed
- Calling
json_encode()on aPackedBoxorPackedItemnow additionally serialises the entire underlying
Box/Itemwhere those objects also implementJsonSerializable. Previously the serialisation only included the
key values from theBox/Iteminterfaces themselves.