Skip to content

Releases: bolt/collection

v1.1.2

12 Oct 23:12
v1.1.2

Choose a tag to compare

  • Fixed: flip() to throw exception instead of triggering warning
  • Fixed: find* methods on empty bags
  • Fixed: code styling
  • Tests: Add PHP 7.2 & nightly to Travis CI

v1.1.1

18 Aug 05:55
v1.1.1
0db519c

Choose a tag to compare

  • Change: Arr::set classes offsetGet is only called once per key now in case there is non-light logic in that method
  • Change: Arr::set now it only gets a known key from an AA object and doesn't need to set a test value
  • Fixed: Arr::set not throwing exception when object cannot return an array by reference for a pre-existing key
  • Fixed: Arr::set false positives for incorrect logic in AA::offsetGet() methods
  • Fixed: Arr::set deprecation warnings not to trigger for MutableBag
  • Fixed: Arr::set exception message to reference MutableBag instead of Bag

v1.1.0

10 Aug 19:32
v1.1.0
2a5c899

Choose a tag to compare

I'm really excited about this release. It brings Bag functionality to up par with builtin array methods and adds several more useful methods and shortcuts.

We also have API documentation generated now.

Major Changes:

  • The mutable bag has been renamed from Bag to MutableBag
  • The immutable bag has been renamed from ImmutableBag to Bag
  • ImmutableBag is now a deprecated class alias to Bag
  • Mutable methods on Bag are deprecated

Minor BC breaks:

  • Bag::first() & Bag::last() now return null instead of false for empty bags
  • Bag::indexOf() now returns null instead of false if the item is not found
  • Methods accepting collections now throw an InvalidArgumentException if the value given is a non-iterable instead of silently converting it to an array with one item
    • Affected methods: from, combine, replace, replaceRecursive, defaults, defaultsRecursive, merge

New Features:

Arr

  • Added from() method
  • Added fromRecursive() method
  • Added mapRecursive() method
  • Added remove() method

Bag

  • Added call() method
  • Added countValues() method
  • Added diffBy() method
  • Added diffKeysBy() method
  • Added diffKeys() method
  • Added diff() method
  • Added findKey() method
  • Added findLastKey() method
  • Added findLast() method
  • Added find() method
  • Added flatten() method
  • Updated indexOf() - added optional parameter $fromIndex
  • Added intersectBy() method
  • Added intersectKeysBy() method
  • Added intersectKeys() method
  • Added intersect() method
  • Added lastIndexOf() method
  • Added of() static method
  • Added omit() method
  • Added pad() method
  • Added pick() method
  • Added randomKey() method
  • Added randomKeys() method
  • Added randomValue() method
  • Added randomValues() method
  • Added reject() method
  • Added sortBy() method
  • Added sortKeysBy() method
  • Added sortKeys() method
  • Added sortKeysWith() method
  • Added sort() method
  • Added sortWith() method

MutableBag

  • Added removePath() method

Other changes:

  • Deprecated: Arr:: assertAccessible
  • Change: Replace Traversable|array in PHPDoc with iterable
  • Added: bolt/common library
  • Added: Code styling & test integration
  • Change: Update Bag to use Arr::from
  • Updated: Usages of Assert to use bolt/common
  • Change: (Optimization) Added Collection classes by default to canReturnArrayByReference list

See all commits since v1.0.0

v1.0.0

27 May 00:55
v1.0.0

Choose a tag to compare

Initial release