Releases: headsnet/collections
Releases · headsnet/collections
Factory methods for instantiation, removed ArrayAccess
What's Changed
- BC BREAK - Require item class name to be provided via abstract method
getItemClassName()
instead of via the collection constructor. - BC BREAK - Removed support for
ArrayAccess
, and replicate functionality via more meaningful methods such asCollection::has()
andCollection::get()
. - BC BREAK -
Collection::toArray()
renamed toCollection::all()
. - Added the factory methods
Collection::from()
andCollection::empty()
. - Added helper methods
Collection::isEmpty()
andCollection::isNotEmpty()
. - Added helper method
Collection::mapTo()
to map to a new Collection of a different type. - Added
Collection::reverse()
helper to reverse the order of the collection. - Support creating collections from Doctrine Collections using
Collection::fromDoctrine()
. - Support creating collections by mapping array of other objects using
Collection::mapFrom()
.
Modernise with generics
What's Changed
- Modernise codebase by @benr77 in #2
- Install Easy Coding Standard by @benr77 in #3
- Configure CI build with Github Actions by @benr77 in #4
- Add code coverage badge generation to CI build by @benr77 in #5
- Add installation, usage and contributing sections to README by @benr77 in #6
- Ensure first() and last() methods return null if collection empty by @benr77 in #7
- Add firstOrFail() and lastOrFail() methods by @benr77 in #8
- Add test cases that ensure the collection immutability by @benr77 in #9
- Add change log file by @benr77 in #10
Full Changelog: v0.1.1...v0.2.0
Fix deprecations
Merge pull request #1 from headsnet/fix-deprecations Fix deprecation notices