scriptibus / abstract-collection
Provides an AbstractCollection which can be extended by any specific collection which can be used as typed array.
This package's canonical repository appears to be gone and the package has been frozen as a result.
1.0.7
2021-01-13 15:47 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- phpunit/phpunit: ^8.4
README
Provides an AbstractCollection which can be extended by any specific collection which can be used as typed array.
- Create your collection class
- Simply extend Scriptibus\AbstractCollection
- Implement getClass() with return YourClass::class
- Override all non-final methods and add typehints
- Add the splat operator (...) to the parent call in __construct()
See an example in the examples directory