Skip to content

Releases: rotexsoft/versatile-collections

New Major Release

14 Mar 22:00
Compare
Choose a tag to compare
  • 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

14 Mar 10:17
Compare
Choose a tag to compare
  • 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

17 Oct 22:28
Compare
Choose a tag to compare

Minor Enhancement

01 Sep 21:02
Compare
Choose a tag to compare
  • Under the hood tweaks

Minor Enhancement

17 May 06:58
Compare
Choose a tag to compare

Major Release

07 Mar 19:57
Compare
Choose a tag to compare

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

10 Jan 19:30
Compare
Choose a tag to compare
  • PHP 7.4 enhancements

Maintenance Release

06 Jan 21:22
Compare
Choose a tag to compare
  • Changed minimum required PHP version to 7.4

Enhancements

15 Apr 00:22
Compare
Choose a tag to compare
  • Changed

    • CollectionInterface::makeNew(array $items=[], bool $preserve_keys=true): CollectionInterface
    • to
    • CollectionInterface::makeNew(iterable $items=[], bool $preserve_keys=true): CollectionInterface
  • Changed

    • SpecificObjectsCollection::makeNewForSpecifiedClassName(?string $class_name=null, array $items =[], bool $preserve_keys=true): StrictlyTypedCollectionInterface
    • to
    • SpecificObjectsCollection::makeNewForSpecifiedClassName(?string $class_name=null, iterable $items =[], bool $preserve_keys=true): StrictlyTypedCollectionInterface

Next Major Release

14 Apr 02:16
Compare
Choose a tag to compare
  • Now using github actions for CI
  • Minimum PHP 7.3
  • More explicit typing (parameter and return types)