v1.1.0
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
BagtoMutableBag - The immutable bag has been renamed from
ImmutableBagtoBag ImmutableBagis now a deprecated class alias toBag- Mutable methods on
Bagare deprecated
Minor BC breaks:
Bag::first()&Bag::last()now returnnullinstead offalsefor empty bagsBag::indexOf()now returnsnullinstead offalseif the item is not found- Methods accepting collections now throw an
InvalidArgumentExceptionif 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
- Affected methods:
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|arrayin PHPDoc withiterable - Added:
bolt/commonlibrary - Added: Code styling & test integration
- Change: Update
Bagto useArr::from - Updated: Usages of
Assertto usebolt/common - Change: (Optimization) Added Collection classes by default to canReturnArrayByReference list