class ReflectionService (View source)

A service for acquiring reflection based information in a performant way. This service also builds up class schema information which is used by the Flow's persistence layer.

The list of available classes from flow packages is determined during initialisation of the CompileTimeObjectManager which also triggers the initial build of reflection data.

During shutdown any reflection changes that occurred are saved to the cache.

The invalidation of reflection cache entries is done by the CacheManager during development via flushClassCachesByChangedFiles by removing the reflected data from the cache.

The internal representation of cache data is optimized for memory consumption.

Constants

protected VISIBILITY_PRIVATE

protected VISIBILITY_PROTECTED

protected VISIBILITY_PUBLIC

protected DATA_INTERFACE_IMPLEMENTATIONS

protected DATA_CLASS_SUBCLASSES

protected DATA_CLASS_ANNOTATIONS

protected DATA_CLASS_ABSTRACT

protected DATA_CLASS_FINAL

protected DATA_CLASS_READONLY

protected DATA_CLASS_METHODS

protected DATA_CLASS_PROPERTIES

protected DATA_METHOD_FINAL

protected DATA_METHOD_STATIC

protected DATA_METHOD_VISIBILITY

protected DATA_METHOD_PARAMETERS

protected DATA_METHOD_DECLARED_RETURN_TYPE

protected DATA_PROPERTY_TAGS_VALUES

protected DATA_PROPERTY_ANNOTATIONS

protected DATA_PROPERTY_VISIBILITY

protected DATA_PROPERTY_TYPE

protected DATA_PROPERTY_PROMOTED

protected DATA_PARAMETER_POSITION

protected DATA_PARAMETER_OPTIONAL

protected DATA_PARAMETER_TYPE

protected DATA_PARAMETER_ARRAY

protected DATA_PARAMETER_CLASS

protected DATA_PARAMETER_ALLOWS_NULL

protected DATA_PARAMETER_DEFAULT_VALUE

protected DATA_PARAMETER_BY_REFERENCE

protected DATA_PARAMETER_SCALAR_DECLARATION

protected DATA_PARAMETER_ANNOTATIONS

Properties

protected $annotationReader
protected $availableClassNames
protected $reflectionDataRuntimeCache
protected $classSchemataRuntimeCache
protected $logger
protected $doctrinePhpParser

The doctrine PHP parser which can parse "use" statements. Is initialized lazily when it is first needed.

protected $useStatementsForClassCache

a cache which stores the use statements reflected for a particular class (only relevant for un-expanded "var" and "param" annotations)

protected $settings
protected $annotatedClasses

Array of annotation classnames and the names of classes which are annotated with them

protected $classesByMethodAnnotations

Array of method annotations and the classes and methods which are annotated with them

protected ClassSchema|false> $classSchemata

Schemata of all classes which can be persisted

protected $classesCurrentlyBeingForgotten

An array of class names which are currently being forgotten by forgetClass(). Acts as a safeguard against infinite loops.

protected $classReflectionData

Array with reflection information indexed by class name

protected $updatedReflectionData

Array with updated reflection information (e.g. in Development context after classes have changed)

protected $initialized
protected $methodAnnotationsRuntimeCache

A runtime cache for reflected method annotations to speed up repeating checks.

Methods

void
void
void
injectSettings(array $settings)

No description

void
injectLogger(LoggerInterface $logger)

No description

PhpParser
getDoctrinePhpParser()

No description

void
initialize()

Initialize the reflection service lazily

void
buildReflectionData(array $availableClassNames)

Builds the reflection data cache during compile time.

bool
isClassReflected(string $className)

Tells if the specified class is known to this reflection service and reflection information is available.

array
getAllClassNames()

Returns the names of all classes known to this reflection service.

string|bool
getDefaultImplementationClassNameForInterface(string $interfaceName)

Searches for and returns the class name of the default implementation of the given interface name. If no class implementing the interface was found or more than one implementation was found in the package defining the interface, false is returned.

array
getAllImplementationClassNamesForInterface(string $interfaceName)

Searches for and returns all class names of implementations of the given object type (interface name). If no class implementing the interface was found, an empty array is returned.

array
getAllSubClassNamesForClass(string $className)

Searches for and returns all names of classes inheriting the specified class.

array
getClassNamesByAnnotation(string $annotationClassName)

Searches for and returns all names of classes which are tagged by the specified annotation. If no classes were found, an empty array is returned.

bool
isClassAnnotatedWith(string $className, string $annotationClassName)

Tells if the specified class has the given annotation

array
getClassAnnotations(string $className, string|null $annotationClassName = null)

Returns the specified class annotations or an empty array

object|null
getClassAnnotation(string $className, string $annotationClassName)

Returns the specified class annotation or NULL.

bool
isClassImplementationOf(string $className, string $interfaceName)

Tells if the specified class implements the given interface

bool
isClassAbstract(string $className)

Tells if the specified class is abstract or not

bool
isClassFinal(string $className)

Tells if the specified class is final or not

bool
isClassReadonly(string $className)

Tells if the specified class is readonly or not

bool
isClassUnconfigurable(string $className)

Tells if the class is unconfigurable or not

array
getClassesContainingMethodsAnnotatedWith(string $annotationClassName)

Returns all class names of classes containing at least one method annotated with the given annotation class

array
getMethodsAnnotatedWith(string $className, string $annotationClassName)

Returns all names of methods of the given class that are annotated with the given annotation class

bool
isMethodFinal(string $className, string $methodName)

Tells if the specified method is final or not

bool
isMethodStatic(string $className, string $methodName)

Tells if the specified method is declared as static or not

bool
isMethodPublic(string $className, string $methodName)

No description

bool
isMethodProtected(string $className, string $methodName)

No description

bool
isMethodPrivate(string $className, string $methodName)

No description

bool
isMethodTaggedWith(string $className, string $methodName, string $tag)

Tells if the specified method is tagged with the given tag

bool
isAttributeIgnored(string $attributeName)

Tells if a specific PHP attribute is to be ignored for reflection

bool
isMethodAnnotatedWith(string $className, string $methodName, string $annotationClassName)

Tells if the specified method has the given annotation

array
getMethodAnnotations(string $className, string $methodName, string|null $annotationClassName = null)

Returns the specified method annotations or an empty array

object|null
getMethodAnnotation(string $className, string $methodName, string $annotationClassName)

Returns the specified method annotation or NULL.

array
getClassPropertyNames(string $className)

Returns the names of all properties of the specified class

bool
hasMethod(string $className, string $methodName)

Wrapper for method_exists() which tells if the given method exists.

array
getMethodTagsValues(string $className, string $methodName) deprecated

Returns all tags and their values the specified method is tagged with

array
getMethodParameters(string $className, string $methodName)

Returns an array of parameters of the given method. Each entry contains additional information about the parameter position, type hint etc.

string|null
getMethodDeclaredReturnType(string $className, string $methodName)

Returns the declared return type of a method (for PHP < 7.0 this will always return null)

array
getPropertyNamesByTag(string $className, string $tag)

Searches for and returns all names of class properties which are tagged by the specified tag.

array
getPropertyTagsValues(string $className, string $propertyName)

Returns all tags and their values the specified class property is tagged with

array
getPropertyTagValues(string $className, string $propertyName, string $tag)

Returns the values of the specified class property tag

string|null
getPropertyType(string $className, string $propertyName)

Returns the property type

bool
isPropertyPrivate(string $className, string $propertyName)

No description

bool
isPropertyPromoted(string $className, string $propertyName)

Tells if the specified property is promoted

bool
isPropertyTaggedWith(string $className, string $propertyName, string $tag)

Tells if the specified class property is tagged with the given tag

bool
isPropertyAnnotatedWith(string $className, string $propertyName, string $annotationClassName)

Tells if the specified property has the given annotation

array
getPropertyNamesByAnnotation(string $className, string $annotationClassName)

Searches for and returns all names of class properties which are marked by the specified annotation. If no properties were found, an empty array is returned.

array
getPropertyAnnotations(string $className, string $propertyName, string|null $annotationClassName = null)

Returns the specified property annotations or an empty array

object|null
getPropertyAnnotation(string $className, string $propertyName, string $annotationClassName)

Returns the specified property annotation or NULL.

ClassSchema|null
getClassSchema(string|object $classNameOrObject)

Returns the class schema for the given class

string
prepareClassReflectionForUsage(string $className)

Initializes the ReflectionService, cleans the given class name and finally reflects the class if necessary.

void
reflectEmergedClasses()

Checks if the given class names match those which already have been reflected. If the given array contains class names not yet known to this service, these classes will be reflected.

bool
isTagIgnored(string $tagName)

Check if a specific annotation tag is configured to be ignored.

void
reflectClass(string $className)

Reflects the given class and stores the results in this service's properties.

int
reflectClassProperty(string $className, PropertyReflection $property)

No description

array|null
reflectPropertyTag(string $className, PropertyReflection $property, string $tagName, array $tagValues)

No description

void
addParentClass(string $className, ClassReflection $parentClass)

No description

void
addImplementedInterface(string $className, ClassReflection $interface)

No description

void
reflectClassMethod(string $className, MethodReflection $method)

No description

int
extractVisibility(PropertyReflection $reflection)

No description

void
reflectClassMethodParameter(string $className, MethodReflection $method, ParameterReflection $parameter)

No description

string
expandType(ClassReflection $class, string $type)

Expand shortened class names in "var" and "param" annotations, taking use statements into account.

array
getParentClasses(ClassReflection $class, array $parentClasses = [])

Finds all parent classes of the given class

void
buildClassSchemata(array $classNames)

Builds class schemata from classes annotated as entities or value objects

buildClassSchema(string $className)

No description

void
addPropertiesToClassSchema(ClassSchema $classSchema)

Adds properties of the class at hand to the class schema.

bool
evaluateClassPropertyAnnotationsForSchema(ClassSchema $classSchema, string $propertyName)

No description

void
completeRepositoryAssignments()

Complete repository-to-entity assignments.

void
makeChildClassesAggregateRoot(ClassSchema $classSchema)

Assigns the repository of any aggregate root to all it's subclasses, unless they are aggregate root already.

void
ensureAggregateRootInheritanceChainConsistency()

Checks whether all aggregate roots having superclasses have a repository assigned up to the tip of their hierarchy.

void
checkValueObjectRequirements(string $className)

Checks if the given class meets the requirements for a value object, i.e.

array
convertParameterDataToArray(array $parametersInformation)

Converts the internal, optimized data structure of parameter information into a human-friendly array with speaking indexes.

array
convertParameterReflectionToArray(ParameterReflection $parameter, MethodReflection $method)

Converts the given parameter reflection into an information array

void
forgetChangedClasses()

Checks which classes lack a cache entry and removes their reflection data accordingly.

void
saveToCache()

Exports the internal reflection data into the ReflectionData cache

string
cleanClassName(string $className)

Clean a given class name from possibly prefixed backslash

string
produceCacheIdentifierFromClassName(string $className)

Transform backslashes to underscores to provide a valid cache identifier.

void
log(string $message, string $severity = LogLevel::INFO, array $additionalData = [])

Writes the given message along with the additional information into the log.

Details

void setReflectionDataRuntimeCache(VariableFrontend $cache)

No description

Parameters

VariableFrontend $cache

Return Value

void

void setClassSchemataRuntimeCache(VariableFrontend $cache)

No description

Parameters

VariableFrontend $cache

Return Value

void

void injectSettings(array $settings)

No description

Parameters

array $settings

Return Value

void

void injectLogger(LoggerInterface $logger)

No description

Parameters

LoggerInterface $logger

Return Value

void

protected PhpParser getDoctrinePhpParser()

No description

Return Value

PhpParser

protected void initialize()

Initialize the reflection service lazily

This method must be run only after all dependencies have been injected.

Return Value

void

void buildReflectionData(array $availableClassNames)

Builds the reflection data cache during compile time.

This method is called by the Compile Time Object Manager which also determines the list of classes to consider for reflection.

bool isClassReflected(string $className)

Tells if the specified class is known to this reflection service and reflection information is available.

Parameters

string $className

Return Value

bool

array getAllClassNames()

Returns the names of all classes known to this reflection service.

Return Value

array

string|bool getDefaultImplementationClassNameForInterface(string $interfaceName)

Searches for and returns the class name of the default implementation of the given interface name. If no class implementing the interface was found or more than one implementation was found in the package defining the interface, false is returned.

Parameters

string $interfaceName

Return Value

string|bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getAllImplementationClassNamesForInterface(string $interfaceName)

Searches for and returns all class names of implementations of the given object type (interface name). If no class implementing the interface was found, an empty array is returned.

Parameters

string $interfaceName

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getAllSubClassNamesForClass(string $className)

Searches for and returns all names of classes inheriting the specified class.

If no class inheriting the given class was found, an empty array is returned.

Parameters

string $className

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getClassNamesByAnnotation(string $annotationClassName)

Searches for and returns all names of classes which are tagged by the specified annotation. If no classes were found, an empty array is returned.

Parameters

string $annotationClassName

Return Value

array

bool isClassAnnotatedWith(string $className, string $annotationClassName)

Tells if the specified class has the given annotation

Parameters

string $className
string $annotationClassName

Return Value

bool

array getClassAnnotations(string $className, string|null $annotationClassName = null)

Returns the specified class annotations or an empty array

Parameters

string $className
string|null $annotationClassName

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

object|null getClassAnnotation(string $className, string $annotationClassName)

Returns the specified class annotation or NULL.

If multiple annotations are set on the target you will get the first instance of them.

Parameters

string $className
string $annotationClassName

Return Value

object|null

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isClassImplementationOf(string $className, string $interfaceName)

Tells if the specified class implements the given interface

Parameters

string $className
string $interfaceName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isClassAbstract(string $className)

Tells if the specified class is abstract or not

Parameters

string $className

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isClassFinal(string $className)

Tells if the specified class is final or not

Parameters

string $className

Name of the class to analyze

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isClassReadonly(string $className)

Tells if the specified class is readonly or not

Parameters

string $className

Name of the class to analyze

Return Value

bool

true if the class is readonly, otherwise false

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isClassUnconfigurable(string $className)

Tells if the class is unconfigurable or not

Parameters

string $className

Return Value

bool

array getClassesContainingMethodsAnnotatedWith(string $annotationClassName)

Returns all class names of classes containing at least one method annotated with the given annotation class

Parameters

string $annotationClassName

Return Value

array

array getMethodsAnnotatedWith(string $className, string $annotationClassName)

Returns all names of methods of the given class that are annotated with the given annotation class

Parameters

string $className
string $annotationClassName

Return Value

array

bool isMethodFinal(string $className, string $methodName)

Tells if the specified method is final or not

Parameters

string $className
string $methodName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isMethodStatic(string $className, string $methodName)

Tells if the specified method is declared as static or not

Parameters

string $className
string $methodName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isMethodPublic(string $className, string $methodName)

No description

Parameters

string $className
string $methodName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isMethodProtected(string $className, string $methodName)

No description

Parameters

string $className
string $methodName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isMethodPrivate(string $className, string $methodName)

No description

Parameters

string $className
string $methodName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isMethodTaggedWith(string $className, string $methodName, string $tag)

Tells if the specified method is tagged with the given tag

Parameters

string $className
string $methodName
string $tag

Return Value

bool

Exceptions

ReflectionException

bool isAttributeIgnored(string $attributeName)

Tells if a specific PHP attribute is to be ignored for reflection

Parameters

string $attributeName

Return Value

bool

bool isMethodAnnotatedWith(string $className, string $methodName, string $annotationClassName)

Tells if the specified method has the given annotation

Parameters

string $className
string $methodName
string $annotationClassName

Return Value

bool

Exceptions

ReflectionException

array getMethodAnnotations(string $className, string $methodName, string|null $annotationClassName = null)

Returns the specified method annotations or an empty array

Parameters

string $className
string $methodName
string|null $annotationClassName

Return Value

array

Exceptions

ReflectionException

object|null getMethodAnnotation(string $className, string $methodName, string $annotationClassName)

Returns the specified method annotation or NULL.

If multiple annotations are set on the target you will get the first instance of them.

Parameters

string $className
string $methodName
string $annotationClassName

Return Value

object|null

Exceptions

ReflectionException

array getClassPropertyNames(string $className)

Returns the names of all properties of the specified class

Parameters

string $className

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool hasMethod(string $className, string $methodName)

Wrapper for method_exists() which tells if the given method exists.

Parameters

string $className
string $methodName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getMethodTagsValues(string $className, string $methodName) deprecated

deprecated since 8.4

Returns all tags and their values the specified method is tagged with

Parameters

string $className
string $methodName

Return Value

array

Exceptions

ReflectionException

array getMethodParameters(string $className, string $methodName)

Returns an array of parameters of the given method. Each entry contains additional information about the parameter position, type hint etc.

Parameters

string $className
string $methodName

Return Value

array

An array of parameter names and additional information or an empty array of no parameters were found

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

string|null getMethodDeclaredReturnType(string $className, string $methodName)

Returns the declared return type of a method (for PHP < 7.0 this will always return null)

Parameters

string $className
string $methodName

Return Value

string|null

The declared return type of the method or null if none was declared

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getPropertyNamesByTag(string $className, string $tag)

Searches for and returns all names of class properties which are tagged by the specified tag.

If no properties were found, an empty array is returned.

Parameters

string $className
string $tag

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getPropertyTagsValues(string $className, string $propertyName)

Returns all tags and their values the specified class property is tagged with

Parameters

string $className
string $propertyName

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getPropertyTagValues(string $className, string $propertyName, string $tag)

Returns the values of the specified class property tag

Parameters

string $className
string $propertyName
string $tag

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

string|null getPropertyType(string $className, string $propertyName)

Returns the property type

Parameters

string $className
string $propertyName

Return Value

string|null

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isPropertyPrivate(string $className, string $propertyName)

No description

Parameters

string $className
string $propertyName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isPropertyPromoted(string $className, string $propertyName)

Tells if the specified property is promoted

Parameters

string $className
string $propertyName

Return Value

bool

bool isPropertyTaggedWith(string $className, string $propertyName, string $tag)

Tells if the specified class property is tagged with the given tag

Parameters

string $className
string $propertyName
string $tag

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

bool isPropertyAnnotatedWith(string $className, string $propertyName, string $annotationClassName)

Tells if the specified property has the given annotation

Parameters

string $className
string $propertyName
string $annotationClassName

Return Value

bool

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getPropertyNamesByAnnotation(string $className, string $annotationClassName)

Searches for and returns all names of class properties which are marked by the specified annotation. If no properties were found, an empty array is returned.

Parameters

string $className
string $annotationClassName

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

array getPropertyAnnotations(string $className, string $propertyName, string|null $annotationClassName = null)

Returns the specified property annotations or an empty array

Parameters

string $className
string $propertyName
string|null $annotationClassName

Return Value

array

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

object|null getPropertyAnnotation(string $className, string $propertyName, string $annotationClassName)

Returns the specified property annotation or NULL.

If multiple annotations are set on the target you will get the first instance of them.

Parameters

string $className
string $propertyName
string $annotationClassName

Return Value

object|null

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

ClassSchema|null getClassSchema(string|object $classNameOrObject)

Returns the class schema for the given class

Parameters

string|object $classNameOrObject

Return Value

ClassSchema|null

protected string prepareClassReflectionForUsage(string $className)

Initializes the ReflectionService, cleans the given class name and finally reflects the class if necessary.

Parameters

string $className

Return Value

string

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

protected void reflectEmergedClasses()

Checks if the given class names match those which already have been reflected. If the given array contains class names not yet known to this service, these classes will be reflected.

protected bool isTagIgnored(string $tagName)

Check if a specific annotation tag is configured to be ignored.

Parameters

string $tagName

Return Value

bool

protected void reflectClass(string $className)

Reflects the given class and stores the results in this service's properties.

Parameters

string $className

Return Value

void

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

int reflectClassProperty(string $className, PropertyReflection $property)

No description

Parameters

string $className
PropertyReflection $property

Return Value

int visibility

protected array|null reflectPropertyTag(string $className, PropertyReflection $property, string $tagName, array $tagValues)

No description

Parameters

string $className
PropertyReflection $property
string $tagName
array $tagValues

Return Value

array|null

protected void addParentClass(string $className, ClassReflection $parentClass)

No description

Parameters

string $className
ClassReflection $parentClass

Return Value

void

Exceptions

InvalidClassException
ClassLoadingForReflectionFailedException
ReflectionException

protected void addImplementedInterface(string $className, ClassReflection $interface)

No description

Parameters

string $className
ClassReflection $interface

Return Value

void

Exceptions

ClassLoadingForReflectionFailedException
InvalidClassException
ReflectionException

protected void reflectClassMethod(string $className, MethodReflection $method)

No description

Parameters

string $className
MethodReflection $method

Return Value

void

Exceptions

ReflectionException

protected int extractVisibility(PropertyReflection $reflection)

No description

Parameters

PropertyReflection $reflection

Return Value

int

protected void reflectClassMethodParameter(string $className, MethodReflection $method, ParameterReflection $parameter)

No description

Parameters

string $className
MethodReflection $method
ParameterReflection $parameter

Return Value

void

protected string expandType(ClassReflection $class, string $type)

Expand shortened class names in "var" and "param" annotations, taking use statements into account.

Parameters

ClassReflection $class
string $type

Return Value

string

protected array getParentClasses(ClassReflection $class, array $parentClasses = [])

Finds all parent classes of the given class

Parameters

ClassReflection $class
array $parentClasses

Return Value

array

protected void buildClassSchemata(array $classNames)

Builds class schemata from classes annotated as entities or value objects

protected void addPropertiesToClassSchema(ClassSchema $classSchema)

Adds properties of the class at hand to the class schema.

Properties will be added if they have a var annotation && (!transient-annotation && !inject-annotation)

Invalid annotations will cause an exception to be thrown.

protected bool evaluateClassPropertyAnnotationsForSchema(ClassSchema $classSchema, string $propertyName)

protected void completeRepositoryAssignments()

Complete repository-to-entity assignments.

This method looks for repositories that declare themselves responsible for a specific model and sets a repository classname on the corresponding models.

It then walks the inheritance chain for all aggregate roots and checks the subclasses for their aggregate root status - if no repository is assigned yet, that will be done.

protected void makeChildClassesAggregateRoot(ClassSchema $classSchema)

Assigns the repository of any aggregate root to all it's subclasses, unless they are aggregate root already.

protected void ensureAggregateRootInheritanceChainConsistency()

Checks whether all aggregate roots having superclasses have a repository assigned up to the tip of their hierarchy.

protected void checkValueObjectRequirements(string $className)

Checks if the given class meets the requirements for a value object, i.e.

does have a constructor and does not have any setter methods.

Parameters

string $className

Return Value

void

Exceptions

InvalidValueObjectException

protected array convertParameterDataToArray(array $parametersInformation)

Converts the internal, optimized data structure of parameter information into a human-friendly array with speaking indexes.

Parameters

array $parametersInformation

Raw, internal parameter information

Return Value

array

Developer friendly version

protected array convertParameterReflectionToArray(ParameterReflection $parameter, MethodReflection $method)

Converts the given parameter reflection into an information array

Parameters

ParameterReflection $parameter
MethodReflection $method

Return Value

array

Parameter information array

protected void forgetChangedClasses()

Checks which classes lack a cache entry and removes their reflection data accordingly.

void saveToCache()

Exports the internal reflection data into the ReflectionData cache

This method is triggered by a signal which is connected to the bootstrap's shutdown sequence.

Return Value

void

Exceptions

Exception

protected string cleanClassName(string $className)

Clean a given class name from possibly prefixed backslash

Parameters

string $className

Return Value

string

protected string produceCacheIdentifierFromClassName(string $className)

Transform backslashes to underscores to provide a valid cache identifier.

Parameters

string $className

Return Value

string

protected void log(string $message, string $severity = LogLevel::INFO, array $additionalData = [])

Writes the given message along with the additional information into the log.

Parameters

string $message
string $severity
array $additionalData

Return Value

void