Constants

ALLOW_PRIVATE

ALLOW_PRIVATE = 1

ALLOW_PROTECTED

ALLOW_PROTECTED = 2

ALLOW_PUBLIC

ALLOW_PUBLIC = 4

DISALLOW_MAGIC_METHODS

DISALLOW_MAGIC_METHODS = 0 : int

ALLOW_MAGIC_GET

ALLOW_MAGIC_GET = 1 << 0 : int

ALLOW_MAGIC_SET

ALLOW_MAGIC_SET = 1 << 1 : int

ALLOW_MAGIC_CALL

ALLOW_MAGIC_CALL = 1 << 2 : int

MAP_TYPES

MAP_TYPES = ['integer' => \Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_INT, 'boolean' => \Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_BOOL, 'double' => \Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_FLOAT]

Properties

$mutatorPrefixes

$mutatorPrefixes

$accessorPrefixes

$accessorPrefixes

$arrayMutatorPrefixes

$arrayMutatorPrefixes

$enableConstructorExtraction

$enableConstructorExtraction

$methodReflectionFlags

$methodReflectionFlags

$magicMethodsFlags

$magicMethodsFlags

$propertyReflectionFlags

$propertyReflectionFlags

$inflector

$inflector

$arrayMutatorPrefixesFirst

$arrayMutatorPrefixesFirst

$arrayMutatorPrefixesLast

$arrayMutatorPrefixesLast

Methods

__construct()

__construct(string[]|null  $mutatorPrefixes = null, string[]|null  $accessorPrefixes = null, string[]|null  $arrayMutatorPrefixes = null, bool  $enableConstructorExtraction = true, int  $accessFlags = self::ALLOW_PUBLIC, \Symfony\Component\String\Inflector\InflectorInterface  $inflector = null, int  $magicMethodsFlags = self::ALLOW_MAGIC_GET | self::ALLOW_MAGIC_SET) : mixed

Parameters

string[]|null $mutatorPrefixes
string[]|null $accessorPrefixes
string[]|null $arrayMutatorPrefixes
bool $enableConstructorExtraction
int $accessFlags
\Symfony\Component\String\Inflector\InflectorInterface $inflector
int $magicMethodsFlags

Returns

mixed —

getProperties()

getProperties(string  $class, array  $context = []) : string[]|null

Gets the list of properties available for the given class.

Parameters

string $class
array $context

Returns

string[]|null —

getTypes()

getTypes(string  $class, string  $property, array  $context = []) : \Symfony\Component\PropertyInfo\Type[]|null

Gets types of a property.

Parameters

string $class
string $property
array $context

Returns

\Symfony\Component\PropertyInfo\Type[]|null —

getTypesFromConstructor()

getTypesFromConstructor(string  $class, string  $property) : ?array

{@inheritdoc}

Parameters

string $class
string $property

Returns

?array —

isReadable()

isReadable(string  $class, string  $property, array  $context = []) : bool|null

Is the property readable?

Parameters

string $class
string $property
array $context

Returns

bool|null —

isWritable()

isWritable(string  $class, string  $property, array  $context = []) : bool|null

Is the property writable?

Parameters

string $class
string $property
array $context

Returns

bool|null —

isInitializable()

isInitializable(string  $class, string  $property, array  $context = []) : ?bool

Is the property initializable? Returns true if a constructor's parameter matches the given property name.

Parameters

string $class
string $property
array $context

Returns

?bool —

getReadInfo()

getReadInfo(string  $class, string  $property, array  $context = []) : ?\Symfony\Component\PropertyInfo\PropertyReadInfo

Get read information object for a given property of a class.

Parameters

string $class
string $property
array $context

Returns

?\Symfony\Component\PropertyInfo\PropertyReadInfo —

getWriteInfo()

getWriteInfo(string  $class, string  $property, array  $context = []) : ?\Symfony\Component\PropertyInfo\PropertyWriteInfo

Get write information object for a given property of a class.

Parameters

string $class
string $property
array $context

Returns

?\Symfony\Component\PropertyInfo\PropertyWriteInfo —

getReflectionParameterFromConstructor()

getReflectionParameterFromConstructor(string  $property, \ReflectionMethod  $reflectionConstructor) : ?\ReflectionParameter

Parameters

string $property
\ReflectionMethod $reflectionConstructor

Returns

?\ReflectionParameter —

extractFromMutator()

extractFromMutator(string  $class, string  $property) : \Symfony\Component\PropertyInfo\Type[]|null

Parameters

string $class
string $property

Returns

\Symfony\Component\PropertyInfo\Type[]|null —

extractFromAccessor()

extractFromAccessor(string  $class, string  $property) : \Symfony\Component\PropertyInfo\Type[]|null

Tries to extract type information from accessors.

Parameters

string $class
string $property

Returns

\Symfony\Component\PropertyInfo\Type[]|null —

extractFromConstructor()

extractFromConstructor(string  $class, string  $property) : \Symfony\Component\PropertyInfo\Type[]|null

Tries to extract type information from constructor.

Parameters

string $class
string $property

Returns

\Symfony\Component\PropertyInfo\Type[]|null —

extractFromDefaultValue()

extractFromDefaultValue(string  $class, string  $property) : ?array

Parameters

string $class
string $property

Returns

?array —

extractFromReflectionType()

extractFromReflectionType(\ReflectionType  $reflectionType, \ReflectionClass  $declaringClass) : array

Parameters

\ReflectionType $reflectionType
\ReflectionClass $declaringClass

Returns

array —

resolveTypeName()

resolveTypeName(string  $name, \ReflectionClass  $declaringClass) : string

Parameters

string $name
\ReflectionClass $declaringClass

Returns

string —

isAllowedProperty()

isAllowedProperty(string  $class, string  $property) : bool

Parameters

string $class
string $property

Returns

bool —

getAccessorMethod()

getAccessorMethod(string  $class, string  $property) : ?array

Gets the accessor method.

Returns an array with a the instance of \ReflectionMethod as first key and the prefix of the method as second or null if not found.

Parameters

string $class
string $property

Returns

?array —

getMutatorMethod()

getMutatorMethod(string  $class, string  $property) : ?array

Returns an array with a the instance of \ReflectionMethod as first key and the prefix of the method as second or null if not found.

Parameters

string $class
string $property

Returns

?array —

getPropertyName()

getPropertyName(string  $methodName, array  $reflectionProperties) : ?string

Parameters

string $methodName
array $reflectionProperties

Returns

?string —

findAdderAndRemover()

findAdderAndRemover(\ReflectionClass  $reflClass, array  $singulars) : array

Searches for add and remove methods.

Parameters

\ReflectionClass $reflClass

The reflection class for the given object

array $singulars

The singular form of the property name or null

Returns

array —

An array containing the adder and remover when found and errors

isMethodAccessible()

isMethodAccessible(\ReflectionClass  $class, string  $methodName, int  $parameters) : array

Returns whether a method is public and has the number of required parameters and errors.

Parameters

\ReflectionClass $class
string $methodName
int $parameters

Returns

array —

camelize()

camelize(string  $string) : string

Camelizes a given string.

Parameters

string $string

Returns

string —

getMethodsFlags()

getMethodsFlags(int  $accessFlags) : int

Return allowed reflection method flags.

Parameters

int $accessFlags

Returns

int —

getPropertyFlags()

getPropertyFlags(int  $accessFlags) : int

Return allowed reflection property flags.

Parameters

int $accessFlags

Returns

int —

getReadVisiblityForProperty()

getReadVisiblityForProperty(\ReflectionProperty  $reflectionProperty) : string

Parameters

\ReflectionProperty $reflectionProperty

Returns

string —

getReadVisiblityForMethod()

getReadVisiblityForMethod(\ReflectionMethod  $reflectionMethod) : string

Parameters

\ReflectionMethod $reflectionMethod

Returns

string —

getWriteVisiblityForProperty()

getWriteVisiblityForProperty(\ReflectionProperty  $reflectionProperty) : string

Parameters

\ReflectionProperty $reflectionProperty

Returns

string —

getWriteVisiblityForMethod()

getWriteVisiblityForMethod(\ReflectionMethod  $reflectionMethod) : string

Parameters

\ReflectionMethod $reflectionMethod

Returns

string —