Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

kherge-archive/php-object-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object Storage

Build Status

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"

Documentation

About

An object store for specific objects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages