abstract class CompilerExtension

Configurator compiling extension.

Properties

protected Compiler $compiler
protected string $name
protected array|object $config
protected Closure $initialization

Methods

setCompiler(Compiler $compiler, string $name)

No description

setConfig(array|object $config)

No description

array|object
getConfig()

Returns extension configuration.

getConfigSchema()

Returns configuration schema.

array
validateConfig(array $expected, array|null $config = null, string|null $name = null) deprecated

Checks whether $config contains only $expected items and returns combined array.

array
loadFromFile(string $file)

Reads configuration from file.

void
loadDefinitionsFromConfig(array $configList)

Loads list of service definitions from configuration.

createLoader()

No description

getInitialization()

No description

string
prefix(string $id)

Prepend extension name to identifier or service name.

void
loadConfiguration()

Processes configuration data. Intended to be overridden by descendant.

void
beforeCompile()

Adjusts DI container before is compiled to PHP class. Intended to be overridden by descendant.

void
afterCompile(ClassType $class)

Adjusts DI container compiled to PHP class. Intended to be overridden by descendant.

Details

at line 36
CompilerExtension setCompiler(Compiler $compiler, string $name)

No description

Parameters

Compiler $compiler
string $name

Return Value

CompilerExtension

at line 49
CompilerExtension setConfig(array|object $config)

No description

Parameters

array|object $config

Return Value

CompilerExtension

at line 64
array|object getConfig()

Returns extension configuration.

Return Value

array|object

at line 73
Schema getConfigSchema()

Returns configuration schema.

Return Value

Schema

at line 86
array validateConfig(array $expected, array|null $config = null, string|null $name = null) deprecated

deprecated use getConfigSchema()

Checks whether $config contains only $expected items and returns combined array.

Parameters

array $expected
array|null $config
string|null $name

Return Value

array

Exceptions

InvalidStateException

at line 106
ContainerBuilder getContainerBuilder()

No description

Return Value

ContainerBuilder

at line 115
array loadFromFile(string $file)

Reads configuration from file.

Parameters

string $file

Return Value

array

at line 128
void loadDefinitionsFromConfig(array $configList)

Loads list of service definitions from configuration.

Prefixes its names and replaces @extension with name in definition.

Parameters

array $configList

Return Value

void

at line 140
protected Loader createLoader()

No description

Return Value

Loader

at line 146
Closure getInitialization()

No description

Return Value

Closure

at line 155
string prefix(string $id)

Prepend extension name to identifier or service name.

Parameters

string $id

Return Value

string

at line 165
void loadConfiguration()

Processes configuration data. Intended to be overridden by descendant.

Return Value

void

at line 174
void beforeCompile()

Adjusts DI container before is compiled to PHP class. Intended to be overridden by descendant.

Return Value

void

at line 183
void afterCompile(ClassType $class)

Adjusts DI container compiled to PHP class. Intended to be overridden by descendant.

Parameters

ClassType $class

Return Value

void

Traits

Strict class for better experience.