herrera-io / object-storage
此包已被废弃,不再维护。没有建议的替代包。
特定对象的存储库。
1.0.0
2013-06-19 18:44 UTC
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
一个简单的对象存储类,只允许“支持”的对象。
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"