Extracts data using the reflection API.
- author Kévin Dunglas
- final
CloneableInstantiable
- Implements
Constants |
public Symfony
|
public Symfony
|
public Symfony
|
public Symfony |
public Symfony |
public Symfony |
public Symfony
|
Properties |
public static array $defaultAccessorPrefixes = ['get', 'is', 'has', 'can']
|
public static array $defaultArrayMutatorPrefixes = ['add', 'remove']
|
public static array $defaultMutatorPrefixes = ['add', 'remove', 'set']
|
Methods |
public __construct(?array $mutatorPrefixes = NULL, ?array $accessorPrefixes = NULL, ?array $arrayMutatorPrefixes = NULL, bool $enableConstructorExtraction = true, int $accessFlags = 4self::ALLOW_PUBLIC, ?Symfony
|
public getProperties(string $class, array $context = []) : ?array |
public getReadInfo(string $class, string $property, array $context = []) : ?Symfony |
public getType(string $class, string $property, array $context = []) : ?Symfony |
public getTypeFromConstructor(string $class, string $property) : ?Symfony |
public getTypes(string $class, string $property, array $context = []) : ?array
|
public getTypesFromConstructor(string $class, string $property) : ?array
|
public getWriteInfo(string $class, string $property, array $context = []) : ?Symfony |
public isInitializable(string $class, string $property, array $context = []) : ?bool |
public isReadable(string $class, string $property, array $context = []) : ?bool |
public isWritable(string $class, string $property, array $context = []) : ?bool |
Constants |
private Symfony |
Properties |
private array $accessorPrefixes |
private array $arrayMutatorPrefixes |
private array $arrayMutatorPrefixesFirst |
private array $arrayMutatorPrefixesLast |
private bool $enableConstructorExtraction |
private Symfony |
private int $magicMethodsFlags |
private int $methodReflectionFlags |
private array $mutatorPrefixes |
private int $propertyReflectionFlags |
private Symfony |
Methods |
private camelize(string $string) : string Camelizes a given string. |
private extractFromAccessor(string $class, string $property) : ?array Tries to extract type information from accessors.
|
private extractFromConstructor(string $class, string $property) : ?array Tries to extract type information from constructor.
|
private extractFromMutator(string $class, string $property) : ?array
|
private extractFromPropertyDeclaration(string $class, string $property) : ?array |
private extractFromReflectionType(ReflectionType $reflectionType, ReflectionClass $declaringClass) : array |
private extractTypeFromConstructor(ReflectionClass $reflectionClass, string $property) : ?Symfony |
private findAdderAndRemover(ReflectionClass $reflClass, array $singulars) : array Searches for add and remove methods.
|
private getAccessorMethod(string $class, string $property) : ?array Gets the accessor method. Returns an array with an instance of \ReflectionMethod as the first key and the prefix of the method as the second, or null if not found. |
private getMethodsFlags(int $accessFlags) : int Return allowed reflection method flags. |
private getMutatorMethod(string $class, string $property) : ?array Returns an array with an instance of \ReflectionMethod as the first key and the prefix of the method as the second, or null if not found. |
private getPropertyFlags(int $accessFlags) : int Return allowed reflection property flags. |
private getPropertyName(string $methodName, array $reflectionProperties) : ?string |
private getReadVisibilityForMethod(ReflectionMethod $reflectionMethod) : string |
private getReadVisibilityForProperty(ReflectionProperty $reflectionProperty) : string |
private getReflectionParameterFromConstructor(string $property, ReflectionMethod $reflectionConstructor) : ?ReflectionParameter |
private getWriteVisibilityForMethod(ReflectionMethod $reflectionMethod) : string |
private getWriteVisibilityForProperty(ReflectionProperty $reflectionProperty) : string |
private isAllowedProperty(string $class, string $property, bool $writeAccessRequired = false) : bool |
private isMethodAccessible(ReflectionClass $class, string $methodName, int $parameters) : array Returns whether a method is public and has the number of required parameters and errors. |
private isNullableProperty(string $class, string $property) : bool |
private resolveTypeName(string $name, ReflectionClass $declaringClass) : string |
Properties |
public static array $defaultAccessorPrefixes = ['get', 'is', 'has', 'can']
|
public static array $defaultArrayMutatorPrefixes = ['add', 'remove']
|
public static array $defaultMutatorPrefixes = ['add', 'remove', 'set']
|