Skip to content

Releases: dvdoug/BoxPacker

v4.0.1

01 Apr 19:12
Compare
Choose a tag to compare

Changed

  • Improved efficiency in packing

v4.0.0

04 Dec 22:28
Compare
Choose a tag to compare

Added

  • Added new enumeration Rotation with values Never, KeepFlat and BestFit
  • Added new getAllowedRotation() method to the Item interface to replace getKeepFlat(). This should return
    one of the new Rotation enum values
  • Added new generateVisualisationURL() method to PackedBox and PackedBoxList. This will generate a custom URL for
    a visualisation you can access via the BoxPacker website
  • Added new packAllPermutations() method to Packer to calculate all possible box combinations
  • Added throwOnUnpackableItem() to Packer to control if an exception is thrown (or not) if an unpackable item is
    found (defaults to true, consistent with previous behaviour)
  • Added getUnpackedItems() to Packer 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 (previously DVDoug\BoxPacker)
  • The signature of the ->canBePacked method on the ConstrainedPlacementItem interface has been changed to replace the
    first two arguments(Box $box, PackedItemList $alreadyPackedItems) with PackedBox $packedBox. This allows
    callbacks to make use of the helper methods provided on PackedBox. 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() and getItems() from PackedBox. Use the new public properties instead
  • Removed ->getItem(), ->getX(), ->getY(), ->getZ(), ->getWidth(), ->getLength() and ->getDepth()
    from PackedItem. Use the new public properties instead
  • Removed deprecated ConstrainedItem. You should use ConstrainedPlacementItem as a replacement
  • Removed getKeepFlat() from the Item interface
  • Removed InfalliblePacker. You can now get the same behaviour by calling ->throwOnUnpackableItem(false) and
    ->getUnpackedItems() on the main Packer class

v3.12.1

02 Dec 17:09
Compare
Choose a tag to compare

Fixed

  • Restored ability to copy/paste the samples from the docs into a non-dev installation

v3.12.0

30 Jul 14:19
Compare
Choose a tag to compare

Changed

  • Improved efficiency in packing

Removed

  • Support for PHP 7.1, 7.2 and 7.3

v3.11.0

04 Feb 17:56
Compare
Choose a tag to compare

Changed

  • Calling json_encode() on a PackedBox or PackedItem now additionally serialises the entire underlying
    Box/Item where those objects also implement JsonSerializable. Previously the serialisation only included the
    key values from the Box/Item interfaces themselves.

v3.10.0

10 Sep 19:57
Compare
Choose a tag to compare

Added

  • Added ItemSorter, BoxSorter and PackedBoxSorter to allow calling applications to have better control over
    sorting decisions
  • Added beStrictAboutItemOrdering() to Packer and VolumePacker

v3.9.4

21 Oct 21:51
Compare
Choose a tag to compare

Changed

  • psr/log compatibility changed from ^1.0 to ^1.0||^2.0||^3.0

v3.9.3

26 Sep 20:03
Compare
Choose a tag to compare

Fixed

  • PHP8.1 deprecations

v3.9.2

04 Jul 17:29
Compare
Choose a tag to compare

Added

  • Optional second parameter $qty to ItemList->insert

Fixed

  • Fixed issue where available width for an item could be miscalculated

Changed

  • Improved memory usage

v3.9.1

05 May 08:08
Compare
Choose a tag to compare

Fixed

  • Fixed issue where available width for an item could be miscalculated at the far end of a box

Changed

  • Improved efficiency in packing in the vertical direction