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 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 $accessorPrefixes = NULL |
private $arrayMutatorPrefixes = NULL |
private $arrayMutatorPrefixesFirst = NULL |
private $arrayMutatorPrefixesLast = NULL |
private $enableConstructorExtraction = NULL |
private $inflector = NULL |
private $magicMethodsFlags = NULL |
private $methodReflectionFlags = NULL |
private $mutatorPrefixes = NULL |
private $propertyReflectionFlags = NULL |
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 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 a the instance of \ReflectionMethod as first key |
private getMethodsFlags(int $accessFlags) : int Return allowed reflection method flags. |
private getMutatorMethod(string $class, string $property) : ?array Returns an array with a the instance of \ReflectionMethod as first key |
private getPropertyFlags(int $accessFlags) : int Return allowed reflection property flags. |
private getPropertyName(string $methodName, array $reflectionProperties) : ?string |
private getReadVisiblityForMethod(ReflectionMethod $reflectionMethod) : string |
private getReadVisiblityForProperty(ReflectionProperty $reflectionProperty) : string |
private getReflectionParameterFromConstructor(string $property, ReflectionMethod $reflectionConstructor) : ?ReflectionParameter |
private getWriteVisiblityForMethod(ReflectionMethod $reflectionMethod) : string |
private getWriteVisiblityForProperty(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']
|