clean / registry
Simple registry pattern implementation
Installs: 24 166
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: dev-master
This package is auto-updated.
Last update: 2024-09-06 09:20:43 UTC
README
Basic implementation of registry pattern that implement a central storage for objects often used throughout the application.
Installation
via Composer:
"require": { "clean/registry": "*" }
Example of Usage
$registry = new Registry() $registry->set('var1', 1); $var1 = $registry->get('var1'); if ($registry->has('var1')) { ... }
or you can extend any class with ReigistryTrait
to add registry methods to it
class MyClass { use \Clean\Registry\RegistryTrait; }