Generate decorators for PHP classes

dev-master 2015-05-11 12:50 UTC

This package is auto-updated.

Last update: 2024-05-29 02:35:34 UTC


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();