dantleech/decorator-generator

Generate decorators for PHP classes

Maintainers

👁 dantleech

Package info

github.com/dantleech/DecoratorGenerator

pkg:composer/dantleech/decorator-generator

Statistics

Installs: 114

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 759ca898781325b85d84564ad94ebfaeb584ef64

  • Daniel Leech <daniel.woop@dantleech.com>

This package is auto-updated.

Last update: 2026-06-29 01:09:35 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();