class BundleGenerator

Properties

protected Configurator $configurator
callable $serializer
string $unserializer

Methods

__construct(Configurator $configurator)

Constructor

string
generate(string $className, array $options = [])

Create and return the source of a bundle based on given Configurator instance

string
exportCallback(string $namespace, callable $callback, string $argument)

Export a given callback as PHP code

string
exportObject(object $obj)

Serialize and export a given object as PHP code

Details

at line 35
__construct(Configurator $configurator)

Constructor

Parameters

Configurator $configurator Configurator

at line 51
string generate(string $className, array $options = [])

Create and return the source of a bundle based on given Configurator instance

Options:

  • autoInclude: automatically load the source of the PHP renderer (default: true)

Parameters

string $className

Name of the bundle class

array $options

Associative array of optional settings

Return Value

string

PHP source for the bundle

at line 206
protected string exportCallback(string $namespace, callable $callback, string $argument)

Export a given callback as PHP code

Parameters

string $namespace

Namespace in which the callback is execute

callable $callback

Original callback

string $argument

Callback's argument (as PHP code)

Return Value

string

PHP code

at line 240
protected string exportObject(object $obj)

Serialize and export a given object as PHP code

Parameters

object $obj

Original object

Return Value

string

PHP code