GeezerVison is showing github.com — GitHub - kherge-archive/php-object-storage: An object store for specific objects.
This repository was archived by the owner on Feb 1, 2020. It is now read-only.
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
|
Repository files navigation

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"
About
An object store for specific objects.
Resources
Stars
18 stars
Watchers
0 watching
Forks