DataClassFactory
class DataClassFactory
Methods
Create a new data class factory.
Build constructor parameter metadata keyed by parameter name.
Get constructor parameters resolved from contextual attributes.
Get public, non-static data properties keyed by name.
Validate that constructor inputs have one supported ownership form.
Build data properties and their selected iterable annotations.
Determine if any declaration can use iterable item metadata.
Determine if a native type can use iterable item metadata.
Resolve nearest class-level iterable annotations across inheritance.
Build named creation method metadata in declaration order.
Compile user-owned creation lifecycle method presence.
Validate mapping ownership and build the output reverse map.
Resolve a fixed construction recipe for an eligible declaration.
Determine if resolved recipe values can be spread directly into the constructor.
Resolve a fixed transformation recipe for an eligible declaration.
Determine if declared values can be copied directly during transformation.
Details
at line 60
__construct(DataPropertyFactory $propertyFactory, DataMethodFactory $methodFactory, DataParameterFactory $parameterFactory, DataIterableAnnotationReader $iterableAnnotationReader, NameMapperResolver $nameMapperResolver, DataConfig $config)
Create a new data class factory.
at line 75
DataClass
build(ReflectionClass $reflectionClass)
Build immutable metadata for a data class.
at line 180
protected array
resolveConstructorParameters(ReflectionClass $reflectionClass, ReflectionMethod|null $constructor)
Build constructor parameter metadata keyed by parameter name.
at line 203
protected array
resolveContextualParameters(array $parameters)
Get constructor parameters resolved from contextual attributes.
at line 223
protected array
resolveReflectionProperties(ReflectionClass $reflectionClass)
Get public, non-static data properties keyed by name.
at line 243
protected void
validateConstructorParameters(string $class, array $parameters, array $properties)
Validate that constructor inputs have one supported ownership form.
at line 271
protected array
resolveProperties(string $class, ReflectionClass $reflectionClass, array $reflectionProperties, ReflectionMethod|null $constructor, array $constructorParameters, NameMapper|null $classInputNameMapper, NameMapper|null $classOutputNameMapper, ReflectionAttribute|null $classAutoLazy)
Build data properties and their selected iterable annotations.
at line 356
protected bool
hasIterableAnnotationCandidate(iterable $declarations)
Determine if any declaration can use iterable item metadata.
at line 370
protected bool
typeCanUseIterableAnnotation(ReflectionType|null $type)
Determine if a native type can use iterable item metadata.
at line 409
protected array
resolveClassAnnotations(ReflectionClass $reflectionClass)
Resolve nearest class-level iterable annotations across inheritance.
at line 437
protected array
resolveMethods(ReflectionClass $reflectionClass)
Build named creation method metadata in declaration order.
at line 466
protected array
resolveLifecycleMethods(ReflectionClass $reflectionClass)
Compile user-owned creation lifecycle method presence.
at line 504
protected array
validateMappings(string $class, array $properties)
Validate mapping ownership and build the output reverse map.
at line 563
protected DataCreationRecipe|null
resolveCreationRecipe(ReflectionClass $reflectionClass, array $contextualParameters, array $properties, array $lifecycleMethods, bool $propertyMorphable)
Resolve a fixed construction recipe for an eligible declaration.
at line 602
protected bool
supportsDirectConstructorInstantiation(ReflectionClass $reflectionClass, ReflectionMethod|null $constructor, array $contextualParameters, array $properties)
Determine if resolved recipe values can be spread directly into the constructor.
at line 628
protected DataTransformationRecipe|null
resolveTransformationRecipe(array $properties)
Resolve a fixed transformation recipe for an eligible declaration.
at line 659
protected bool
supportsBulkCopyTransformation(array $properties)
Determine if declared values can be copied directly during transformation.