Releases: rotexsoft/versatile-collections
Release list
Minor Release
Under the hood tweaks and dev related changes
- Added php 8.5 to GitHub actions test suite
- Upgraded actions/checkout from v 4 to 6
- Added PHPunit 12 for environments where PHP 8.3+ is available
- Enabled more rector rules to help improve code-base
- Psalm and Rector recommended under the hood tweaks
Full Changelog: 7.0.0...7.0.1
New Major Release
- Minimum PHP version is now 8.2
- Updated dev dependencies
- PHPUnit from 10 to 11
- Rector from 1 to 2
- Psalm 6
- Made nullable method parameters and return types explicitly declared to include null
Full Changelog: 6.0.0...7.0.0
New Major Release
-
PHP 8.1 is now the minimum version
-
More type hinting around the code-base
-
CollectionInterface signature changes also impacts CollectionInterfaceImplementationTrait & all classes that implement it
- __get(string $key):mixed
- __set(string $key, mixed $val): void
- appendItem(mixed $item): CollectionInterface
- column(int|string $column_key, int|string|null $index_key=null): GenericCollection
- containsItem(mixed $item): bool
- containsItemWithKey(int|string $key, mixed $item): bool
- containsKey(int|string $key): bool
- each(callable $callback, mixed $termination_value=false, bool $bind_callback_to_this=true): CollectionInterface
- firstItem(): mixed
- getAndRemoveFirstItem (): mixed
- getAndRemoveLastItem(): mixed
- getAsNewType(string|CollectionInterface $new_collection_class=GenericCollection::class): CollectionInterface
- getIfExists(string|int $key, mixed $default_value=null): mixed
- lastItem(): mixed
- offsetExists(mixed $key): bool
- offsetGet(mixed $key): mixed
- offsetSet($key, mixed $val): void
- prependItem(mixed $item, string|int|null $key=null): CollectionInterface
- pull(int|string $key, mixed $default = null): mixed
- push(mixed $item): CollectionInterface
- put(int|string $key, mixed $value): CollectionInterface
- randomItem(): mixed
- randomKey(): int|string
- reduce(callable $reducer, mixed $initial_value=NULL)
- reduceWithKeyAccess(callable $reducer, mixed $initial_value=NULL)
- searchAllByVal( mixed $value, bool $strict = false ): array|false
- searchByVal(mixed $value, bool $strict = false ): mixed
- setValForEachItem(string $field_name, mixed $field_val, bool $add_field_if_not_present=false): CollectionInterface
- whenFalse($falsy_value, callable $callback, callable $default=null): mixed
- whenTrue($truthy_value, callable $callback, callable $default=null): mixed
-
CollectionInterfaceImplementationTrait signature changes
- __construct(mixed ...$items)
- performMultiSort(array $array_to_be_sorted, MultiSortParameters ...$param): array
-
FloatsCollection signature changes
- itemToString(float|int $item): string
-
IntsCollection signature changes
- itemToString(float|int $item): string
-
NumericsCollection signature changes
- itemFromString(string $str): float|int
- itemToString(float|int $item): string
-
StrictlyTypedCollectionInterface & every class that implements it
- checkType(mixed $item): bool
-
StrictlyTypedCollectionInterfaceImplementationTrait
- __construct(mixed ...$arr_objs)
- isRightTypeOrThrowInvalidTypeException(mixed $item, string $calling_functions_name): bool
-
Utils
- gettype(mixed $var): string
-
src/helper-functions.php
- get_object_property_value(object $obj, string|int $property, mixed $default_val=null, bool $access_private_or_protected=false): mixed
- object_has_property(object $obj, string|int $property): bool
- random_array_key(array $array): string|int|null
- dump_var(mixed $var): void
Full Changelog: 5.3.0...6.0.0
New Major Release
- Updated dev dependencies
- CollectionInterfaceImplementationTrait.php
- protected function performMultiSort(array $array_to_be_sorted, MultiSortParameters ...$param)
- changed to protected function performMultiSort(array $array_to_be_sorted, MultiSortParameters ...$param): array
- MultiSortParameters
- protected $field_name = '';
- changed to protected string $field_name = '';
Full Changelog: 5.2.0...5.3.0
Maintenance Release
Minor Enhancement
Minor Enhancement
- Added \VersatileCollections\NonArrayIterablesCollection, a sub-class of ObjectsCollection, for storing instances of classes that are iterables.
- This new collection class does not store arrays because they are not objects, even though they are also iterables. Use ArraysCollection to store arrays or you can create a new custom collection class for storing all types of iterables including arrays.
Major Release
Changed
StrictlyTypedCollectionInterface::getType():string
to
StrictlyTypedCollectionInterface::getTypes():StringsCollection
This is a backwards incompatible change. All classes implementing StrictlyTypedCollectionInterface will have to be updated to work with this version.
Maintenance Release
Maintenance Release
- Changed minimum required PHP version to 7.4