herrera-io / object-storage
An object store for specific objects.
Installs: 1 207
Dependents: 3
Suggesters: 0
Security: 0
Stars: 17
Watchers: 3
Forks: 2
pkg:composer/herrera-io/object-storage
Requires
- php: >=5.3.3
Requires (Dev)
- herrera-io/phpunit-test-case: 1.*
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2021-12-07 01:34:54 UTC
README
A simple object storage class that will only allow "supported" objects.
class MyObjectStorage extends Herrera\Util\ObjectStorage { public function isSupported($object) { return ($object instanceof PDO); } } $store = new MyObjectStorage(); $pdo = new PDO('dsn...'); $time = new DateTime(); $store->attach($pdo); $store->attach($time); // throws "UnexpectedValueException"