ConfigBuilderGenerator
in package
implements
ConfigBuilderGeneratorInterface
Generate ConfigBuilders to help create valid config.
Tags
Table of Contents
Interfaces
- ConfigBuilderGeneratorInterface
- Generates ConfigBuilders to help create valid config.
Properties
- $classes : array<string|int, ClassBuilder>
- $outputDir : string
Methods
- __construct() : mixed
- build() : Closure
- buildConstructor() : void
- buildNode() : void
- buildSetExtraKey() : void
- buildToArray() : void
- getComment() : string
- getFullPath() : string
- getParameterType() : string|null
- getSingularName() : string
- Pick a good singular name.
- getSubNamespace() : string
- getType() : string
- handleArrayNode() : void
- handlePrototypedArrayNode() : void
- handleScalarNode() : void
- handleVariableNode() : void
- hasNormalizationClosures() : bool
- writeClasses() : void
Properties
$classes
private
array<string|int, ClassBuilder>
$classes
= []
$outputDir
private
string
$outputDir
Methods
__construct()
public
__construct(string $outputDir) : mixed
Parameters
- $outputDir : string
build()
public
build(ConfigurationInterface $configuration) : Closure
Parameters
- $configuration : ConfigurationInterface
Return values
Closure —that will return the root config class
buildConstructor()
private
buildConstructor(ClassBuilder $class) : void
Parameters
- $class : ClassBuilder
buildNode()
private
buildNode(NodeInterface $node, ClassBuilder $class, string $namespace) : void
Parameters
- $node : NodeInterface
- $class : ClassBuilder
- $namespace : string
buildSetExtraKey()
private
buildSetExtraKey(ClassBuilder $class) : void
Parameters
- $class : ClassBuilder
buildToArray()
private
buildToArray(ClassBuilder $class) : void
Parameters
- $class : ClassBuilder
getComment()
private
getComment(VariableNode $node) : string
Parameters
- $node : VariableNode
Return values
stringgetFullPath()
private
getFullPath(ClassBuilder $class) : string
Parameters
- $class : ClassBuilder
Return values
stringgetParameterType()
private
getParameterType(NodeInterface $node) : string|null
Parameters
- $node : NodeInterface
Return values
string|nullgetSingularName()
Pick a good singular name.
private
getSingularName(PrototypedArrayNode $node) : string
Parameters
- $node : PrototypedArrayNode
Return values
stringgetSubNamespace()
private
getSubNamespace(ClassBuilder $rootClass) : string
Parameters
- $rootClass : ClassBuilder
Return values
stringgetType()
private
getType(string $classType, bool $hasNormalizationClosures) : string
Parameters
- $classType : string
- $hasNormalizationClosures : bool
Return values
stringhandleArrayNode()
private
handleArrayNode(ArrayNode $node, ClassBuilder $class, string $namespace) : void
Parameters
- $node : ArrayNode
- $class : ClassBuilder
- $namespace : string
handlePrototypedArrayNode()
private
handlePrototypedArrayNode(PrototypedArrayNode $node, ClassBuilder $class, string $namespace) : void
Parameters
- $node : PrototypedArrayNode
- $class : ClassBuilder
- $namespace : string
handleScalarNode()
private
handleScalarNode(ScalarNode $node, ClassBuilder $class) : void
Parameters
- $node : ScalarNode
- $class : ClassBuilder
handleVariableNode()
private
handleVariableNode(VariableNode $node, ClassBuilder $class) : void
Parameters
- $node : VariableNode
- $class : ClassBuilder
hasNormalizationClosures()
private
hasNormalizationClosures(NodeInterface $node) : bool
Parameters
- $node : NodeInterface
Return values
boolwriteClasses()
private
writeClasses() : void