Skip to content

PHP Basics v2.0.0

Choose a tag to compare

@sebastian-meyer sebastian-meyer released this 31 Mar 15:57
· 34 commits to main since this release

This is a major release.

Breaking Changes:

  • Raised minimum PHP version from 8.0 to 8.1 in order to use new features like array_is_list() and the spread operator on string-keyed arrays
  • Interface traits renamed and moved to a different namespace
    OCC\Basics\InterfaceTraits\ArrayAccess       -> OCC\Basics\Interfaces\ArrayAccessTrait
    OCC\Basics\InterfaceTraits\Countable         -> OCC\Basics\Interfaces\CountableTrait
    OCC\Basics\InterfaceTraits\IteratorAggregate -> OCC\Basics\Interfaces\IteratorAggregateTrait
    OCC\Basics\InterfaceTraits\Iterator          -> OCC\Basics\Interfaces\IteratorTrait
    
  • Prefixed internal methods for OCC\Basics\Traits\Getter and OCC\Basics\Traits\Setter with _ to avoid confusion with regular class methods
    // old methods
    function magicGet{Property}(): mixed
    function magicSet{Property}(mixed $value): void
    
    // new methods
    function _magicGet{Property}(): mixed
    function _magicSet{Property}(mixed $value): void
    

New Features:

  • Added new datastructure OCC\Basics\DataStructures\StrictCollection
  • Added new datastructure OCC\Basics\DataStructures\StrictArray
  • Added new error handler OCC\Basics\ErrorHandlers\TriggerExceptionError
  • Added new trait OCC\Basics\Traits\OverloadingGetter
  • Added new trait OCC\Basics\Traits\OverloadingSetter
  • Added new trait OCC\Basics\Traits\TypeChecker
  • Extended API for all datastructures (see OCC\Basics\DataStructures\Traits\StrictSplDatastructureTrait)
  • Introduced OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException for strict datastructures
  • Extended documentation

Full Changelog: v1.1.0...v2.0.0