大坦克/装饰器生成器

为PHP类生成装饰器

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

This package is auto-updated.

Last update: 2024-08-29 03:12:32 UTC


README

这是一个生成装饰器的小型库,其主要目的是在保持对象类类型的同时,为对象提供新的类名。

$object = new \stdClass;

$factory = new DecoratorFactory('/path/to/cache', new DecoratorGenerator());
$decorator = $factory->generate($object, 'NewClass\Fqn\ClassName');
$decorated = new \NewClass\Fqn\ClassName();