dantleech / decorator-generator
Generate decorators for PHP classes
dev-master
2015-05-11 12:50 UTC
Requires
- zendframework/zend-code: >2.2.5,<3.0
Requires (Dev)
- symfony/filesystem: ~2.0
This package is auto-updated.
Last update: 2024-10-29 03:28:00 UTC
README
This is a small library for generating decorators for objects. Its only purpose is to provide the object with a new class name whilst maintaining its class type.
$object = new \stdClass; $factory = new DecoratorFactory('/path/to/cache', new DecoratorGenerator()); $decorator = $factory->generate($object, 'NewClass\Fqn\ClassName'); $decorated = new \NewClass\Fqn\ClassName();