CompilerExtension
abstract class CompilerExtension
Base class for compiler extensions that hook into the DI container compilation process.
Properties
| protected | $compiler | ||
| protected | $name | ||
| protected array<string,mixed>|object | $config | ||
| protected | $initialization |
Methods
Sets the validated configuration for this extension.
Returns extension configuration.
Returns configuration schema.
Checks whether $config contains only $expected items and returns combined array.
No description
Reads configuration from file.
Loads list of service definitions from configuration.
No description
Returns the closure whose body is emitted inside the container's initialize() method.
Prepend extension name to identifier or service name.
Processes extension configuration and registers services. Override in subclasses.
Adjusts the container before compilation. Override in subclasses.
Adjusts the generated container class. Override in subclasses.
Details
at line 29
CompilerExtension
setCompiler(Compiler $compiler, string $name)
| internal |
No description
at line 42
CompilerExtension
setConfig(array|object $config)
Sets the validated configuration for this extension.
at line 53
array|object
getConfig()
Returns extension configuration.
at line 62
Schema
getConfigSchema()
Returns configuration schema.
at line 78
array
validateConfig(array $expected, array|null $config = null, string|null $name = null)
deprecated
deprecated
Checks whether $config contains only $expected items and returns combined array.
at line 99
ContainerBuilder
getContainerBuilder()
No description
at line 109
array
loadFromFile(string $file)
Reads configuration from file.
at line 123
void
loadDefinitionsFromConfig(array $configList)
Loads list of service definitions from configuration.
Prefixes its names and replaces @extension with name in definition.
at line 135
protected Loader
createLoader()
No description
at line 144
Closure
getInitialization()
Returns the closure whose body is emitted inside the container's initialize() method.
at line 153
string
prefix(string $id)
Prepend extension name to identifier or service name.
at line 163
void
loadConfiguration()
Processes extension configuration and registers services. Override in subclasses.
at line 172
void
beforeCompile()
Adjusts the container before compilation. Override in subclasses.
at line 181
void
afterCompile(ClassType $class)
Adjusts the generated container class. Override in subclasses.