Releases: ramsey/collection
Releases · ramsey/collection
2.1.1
2.1.0
Added
- Add support for retrieving properties on collection items that are accessible via magic methods
__get
and__isset
(#126) - Certify support for PHP 8.3 and 8.4 (#127)
Fixed
- Use the correct return type annotation of
list<T>
instead ofarray<int, mixed>
forCollectionInterface::column()
(#124) - If an element has a property and method of the same name, check the property visibility on the element before attempting to access it; if it is private, attempt to call the method instead (#123)
ValueExtractorTrait
expectsgetType(): string
to exist on the using class, but it did not declare an abstract to force this requirement; now it does, and any classes using this trait must implementgetType(): string
- Avoid calling
contains()
twice when usingAbstractSet::add()
, significantly improving performance for very large collections (#68)
2.0.0
Added
- Add support for
CollectionInterface::reduce()
(#87) - All exceptions now implement a base
CollectionException
interface - Introduce
Sort
enum - Support
column()
,sort()
, andwhere()
on non-object collection types
Changed
- Minimum PHP version supported is 8.1
- Every method now has parameter and return type hints; if extending classes or implementing interfaces, you may need to change method signatures to upgrade
- The second parameter of
CollectionInterface::sort()
now uses the newSort
enum instead of a string - Audit all template annotations and clean up Psalm and PHPStan types for correctness; if using static analysis in projects, this may require changes to your type annotations
ArrayInterface
no longer extends\Serializable
, and theserialize()
andunserialize()
methods have been removed fromAbstractArray
; however,AbstractArray
still supports serialization through implementing__serialize()
and__unserialize()