Skip to content

v3.0.0-rc1

Pre-release
Pre-release
Compare
Choose a tag to compare
@marc-mabe marc-mabe released this 19 Oct 08:38
· 176 commits to master since this release

First Release Candidate of new major version

We have worked a lot to make this library even more useful and also optimized the performance a lot!
To be able to do so we introduced a couple of BC breaks (please read the changes carefully) but we tried to keep them as small as possible.

Changes

  • #68 remove deprecated methods
  • #69 bumped up PHP version to >=5.6
    • new language features helps us to better maintain this library and provides better optimized code
    • we decided to bump up the supported PHP version as PHP-5.3 is outdated for a long time now
    • we decided to still keep PHP-5.6 (even if outdated as well) as this library is still compatible with HHVM. This way HHVM users can use this new version and have more time to migrate
  • #87 added phpbench suite
  • #73 EnumSet::setBinaryBitset*(): now throws an exception on out-of-range bits set
  • #86 refactored EnumSet to be auto based on integer or binary bitset dependent on enumeration size
    • Methods changed:
      • union(), intersect(), diff() and symDiff() support one argument of $others only
    • Methods added:
      • public function getBit(int $ordinal) : bool
      • public function setBit(int $ordinal, bool $bit) : void
  • #70 removed iterator flags for EnumMap
    • the key will be the enumerator object and the value the assigned data
  • #90 #91 #92 Refactor EnumMap
    • if data are serializable the EnumMap is serializable, too
    • no longer based on SplObjectStorage
    • no longer implement Serializable
    • still implements ArrayAccess, Countable and Iterator
    • new implements SeekableIterator
    • Methods removed:
      • public function attach($enumerator) : void
        • please use public function offsetSet($enumerator) : void
        • or direct array access $map[$enum] = $value
      • public function detach($enumerator): void
        • please use public function offsetUnset($enumerator) : void
        • or direct array access unset($map[$enum])
      • public addAll(SplObjectStorage $storage) : void
      • public getHash(object $object) : string
      • public removeAll(SplObjectStorage $storage) : void
      • public removeAllExcept(SplObjectStorage $storage) : void
      • public serialize(void) : string
      • public setInfo(mixed $data) : void
      • public unserialize(string $serialized) : void
    • Methods changed:
      • public contains($enumerator) : bool
        • same as public offsetExists($enumerator) : bool but returns true on NULL values
    • Methods added:
      • public function seek(int $pos) : void
      • public function getKeys() : Enum[]
      • public function getValues() : mixed[]
      • public function search($enumerator, bool $strict) : Enum|null

https://github.com/marc-mabe/php-enum/issues?utf8=%E2%9C%93&q=is%3Aclosed+milestone%3A3.0.0