Note: I'm not mentioning the plethora of functions that I'm adding with every minor version bump. Take a look at the full function list. This changelog will only list breaking changes.
- Improve return types in PHPDoc
- Add PHPstan badge to README
- Code improvements
- Add conditional return types in PHPDoc
- Dropped support for PHP 7.1
- Test compatibility with PHP 8.1 and 8.2
- Added type hints to a lot of functions
- Alas!
match
is a reserved keyword in PHP8, so ourmatch
function had to be renamed to the more verbosematch_regex
. This is a breaking change: make sure to update your references to this function!
- Moved TypeClasses to namespace
Garp\Functional\Types\TypeClasses
, to not confuse the terms.
- All functions also publish a constant by the same name. This allows you to pass around the function as if you had a reference to it.
- Noticed function
subtract
contained a typo: it was calledsubstract
. Added deprecation notice to the old one and added a new, correctly spelled,subtract
.
- Bumped PHP dependency to 7.1. The library now declares strict types and uses the iterable type to validate arguments.
- Moved all functions to the root folder
functions
and renamed their files to reflect the actual function: from camelCase to snake_case. This shouldn't affect you if you use Composer to load files, but on the off-chance you're manually including these files, note that it will break. - Not a breaking change, but a significant change nonetheless: slowly but surely typeclasses will be added to the library.
- I've changed
flatten
in a backward-incompatible way: it won't unpack associative arrays any further - Also, I'm starting to introduce PHP 7 features into the library. It is time. I will be revisiting the entire library to see if I can add stricter type checking and other PHP 7 features that're long overdue.
- A minor breaking change:
sort_by
no longer accepts a string as its first parameter, but instead wants a function argument. You can achieve the same result by usingsort_by(prop('my_prop'), $my_collection)
.
- Some awesome things transpired.