Skip to content

Releases: rotexsoft/versatile-collections

Documentation update and dependency resolution fix

07 Feb 12:48
Compare
Choose a tag to compare
  • Updated documentation
  • Updated requirement for sebastian/exporter to ^2.0 || ^3.0 because users already requiring ^3.0 in their projects were experiencing conflicts because it is not compatible with ^2.0

Completed Documentation and added new Methods

01 Dec 04:52
Compare
Choose a tag to compare
  • Completed Documentation
  • Added the following methods to CollectionInterface and implemented them in CollectionInterfaceImplementationTrait:
    • __get, __isset, __set, __unset, allSatisfyConditions, diff, diffUsing, diffAssoc, diffAssocUsing, diffKeys, diffKeysUsing, intersectByKeys, intersectByItems, intersectByKeysAndItems, intersectByKeysUsingCallback, intersectByItemsUsingCallback & intersectByKeysAndItemsUsingCallbacks
  • Renamed getValues() to getItems()
  • Added the helper function VersatileCollections\dump_var($var) for debugging purposes

Enhancements

23 Aug 22:13
Compare
Choose a tag to compare
  • get_object_property_value() now has the ability to get the value for protected or private properties.
  • object_has_property() can now detect the existence of non-{public|protected|private} dynamically assigned properties on any object.
  • \VersatileCollections\CollectionInterface::sortByMultipleFields() and
    \VersatileCollections\CollectionInterface::sortMeByMultipleFields() now
    work with any type of object (not just only those that implement ArrayAccess)
  • \VersatileCollections\CollectionInterface::column() can now extract values
    from private and / or protected fields in each object in a collection.

Rearchitected to use traits and interfaces

14 Jul 03:42
Compare
Choose a tag to compare
  • Tonnes of new methods and re-architected the package to rely on interfaces and traits.

  • Consumers of this package that want to make any of their application's classes (that already have a parent class) leverage the functionality in this package only need to implement and use either CollectionInterface and CollectionInterfaceImplementationTrait or StrictlyTypedCollectionInterface and StrictlyTypedCollectionInterfaceImplementationTrait

  • More unit tests and almost on par with Laravel's collections in terms of features

  • The randomItem(), randomItems(), randomKey() and randomKeys() methods use PHP 7's random_int() ( a cryptographically secure pseudo-random integers generator) for better randomness than php's array_rand() (which uses a pseudo random number generator that is not suitable for cryptographic purposes). paragonie/random_compat is used by this package to provide random_int() functionality for PHP 5.6 users of this package

  • Using sebastian/exporter for dumping variables when exceptions occur. This is because php's var_export() does not handle recursion in objects properly

  • Added ArraysCollection

  • Got rid of the BaseCollection class and now using CollectionInterfaceImplementationTrait instead

  • Got rid of the StrictlyTypedCollection class and now using StrictlyTypedCollectionInterfaceImplementationTrait instead

  • Renamed collection classes with singular prefixes to now use plural prefixes for consistency sake. E.g. IntCollection is now IntsCollection

  • Added powerful sorting methods

  • and tonnes of improvements

Performance improvements

08 May 03:16
Compare
Choose a tag to compare
  • Performance improvements

Added \VersatileCollections\CollectionInterface::makeNewCollection(array $items=[])

07 May 21:27
Compare
Choose a tag to compare
  • \VersatileCollections\CollectionInterface::makeNewCollection(array $items=[])

Removed some magic methods from CollectionInterface

07 May 16:15
Compare
Choose a tag to compare

Removed __get, __set, __isset & __unset from CollectionInterface

First Stable Release

06 May 09:14
Compare
Choose a tag to compare

First Stable Release