PHP Class Neos\Flow\Reflection\ReflectionService

Reflection of classes of all active packages is triggered through the bootstrap's initializeReflectionService() method. In a development context, single classes may be re-reflected once files are modified whereas in a production context reflection is done once and successive requests read from the frozen caches for performance reasons. The list of available classes is determined by the CompiletimeObjectManager which also triggers the initial build of reflection data in this service. The invalidation of reflection cache entries is done by the CacheManager which in turn is triggered by signals sent by the file monitor. The internal representation of cache data is optimized for memory consumption and speed by using constants which have an integer value.
Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$annotatedClasses array Array of annotation classnames and the names of classes which are annotated with them
$annotationReader Doctrine\Common\Annotations\Reader
$availableClassNames array
$classLoader Neos\Flow\Core\ClassLoader
$classReflectionData array Array with reflection information indexed by class name
$classSchemata array<\Neos\Flow\Reflection\ClassSchema> Schemata of all classes which can be persisted
$classSchemataRuntimeCache Neos\Cache\Frontend\VariableFrontend
$classesByMethodAnnotations array Array of method annotations and the classes and methods which are annotated with them
$classesCurrentlyBeingForgotten array An array of class names which are currently being forgotten by forgetClass(). Acts as a safeguard against infinite loops.
$context Neos\Flow\Core\ApplicationContext
$doctrinePhpParser Doctrine\Common\Annotations\PhpParser Note: Don't refer to this member directly but use getDoctrinePhpParser() to obtain an instance
$environment Neos\Flow\Utility\Environment
$initialized boolean
$loadFromClassSchemaRuntimeCache boolean In Production context, with frozen caches, this flag will be TRUE
$packageManager Neos\Flow\Package\PackageManagerInterface
$reflectionDataCompiletimeCache Neos\Cache\Frontend\VariableFrontend
$reflectionDataRuntimeCache Neos\Cache\Frontend\VariableFrontend
$settings array
$statusCache Neos\Cache\Frontend\StringFrontend
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$updatedReflectionData array Array with updated reflection information (e.g. in Development context after classes have changed)
$useStatementsForClassCache array a cache which stores the use statements reflected for a particular class (only relevant for un-expanded "var" and "param" annotations)

Public Methods

Method Description
buildReflectionData ( array $availableClassNames ) : void Builds the reflection data cache during compile time.
freezePackageReflection ( string $packageKey ) : void Stores the current reflection data related to classes of the specified package in the PrecompiledReflectionData directory for the current context.
getAllClassNames ( ) : array Returns the names of all classes known to this reflection service.
getAllImplementationClassNamesForInterface ( string $interfaceName ) : array 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.
getAllSubClassNamesForClass ( string $className ) : array Searches for and returns all names of classes inheriting the specified class.
getClassAnnotation ( string $className, string $annotationClassName ) : object Returns the specified class annotation or NULL.
getClassAnnotations ( string $className, string $annotationClassName = null ) : array Returns the specified class annotations or an empty array
getClassNameByObject ( object $object ) : string Returns the class name of the given object. This is a convenience method that returns the expected class names even for proxy classes.
getClassNamesByAnnotation ( string $annotationClassName ) : array 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.
getClassPropertyNames ( string $className ) : array Returns the names of all properties of the specified class
getClassSchema ( mixed $classNameOrObject ) : ClassSchema Returns the class schema for the given class
getClassesContainingMethodsAnnotatedWith ( string $annotationClassName ) : array Returns all class names of classes containing at least one method annotated with the given annotation class
getDefaultImplementationClassNameForInterface ( string $interfaceName ) : mixed 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.
getMethodAnnotation ( string $className, string $methodName, string $annotationClassName ) : object Returns the specified method annotation or NULL.
getMethodAnnotations ( string $className, string $methodName, string $annotationClassName = null ) : array Returns the specified method annotations or an empty array
getMethodDeclaredReturnType ( string $className, string $methodName ) : string Returns the declared return type of a method (for PHP < 7.0 this will always return null)
getMethodParameters ( string $className, string $methodName ) : array Returns an array of parameters of the given method. Each entry contains additional information about the parameter position, type hint etc.
getMethodTagsValues ( string $className, string $methodName ) : array Returns all tags and their values the specified method is tagged with
getMethodsAnnotatedWith ( string $className, string $annotationClassName ) : array Returns all names of methods of the given class that are annotated with the given annotation class
getPropertyAnnotation ( string $className, string $propertyName, string $annotationClassName ) : object Returns the specified property annotation or NULL.
getPropertyAnnotations ( string $className, string $propertyName, string $annotationClassName = null ) : array Returns the specified property annotations or an empty array
getPropertyNamesByAnnotation ( string $className, string $annotationClassName ) : array 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.
getPropertyNamesByTag ( string $className, string $tag ) : array Searches for and returns all names of class properties which are tagged by the specified tag.
getPropertyTagValues ( string $className, string $propertyName, string $tag ) : array Returns the values of the specified class property tag
getPropertyTagsValues ( string $className, string $propertyName ) : array Returns all tags and their values the specified class property is tagged with
hasMethod ( string $className, string $methodName ) : boolean Wrapper for method_exists() which tells if the given method exists.
injectClassLoader ( ClassLoader $classLoader ) : void
injectEnvironment ( Environment $environment ) : void
injectPackageManager ( Neos\Flow\Package\PackageManagerInterface $packageManager ) : void
injectSettings ( array $settings ) : void
injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
isClassAbstract ( string $className ) : boolean Tells if the specified class is abstract or not
isClassAnnotatedWith ( string $className, string $annotationClassName ) : boolean Tells if the specified class has the given annotation
isClassFinal ( string $className ) : boolean Tells if the specified class is final or not
isClassImplementationOf ( string $className, string $interfaceName ) : boolean Tells if the specified class implements the given interface
isClassReflected ( string $className ) : boolean Tells if the specified class is known to this reflection service and reflection information is available.
isClassUnconfigurable ( string $className ) : boolean Tells if the class is unconfigurable or not
isMethodAnnotatedWith ( string $className, string $methodName, string $annotationClassName ) : boolean Tells if the specified method has the given annotation
isMethodFinal ( string $className, string $methodName ) : boolean Tells if the specified method is final or not
isMethodPrivate ( string $className, string $methodName ) : boolean Tells if the specified method is private
isMethodProtected ( string $className, string $methodName ) : boolean Tells if the specified method is protected
isMethodPublic ( string $className, string $methodName ) : boolean Tells if the specified method is public
isMethodStatic ( string $className, string $methodName ) : boolean Tells if the specified method is declared as static or not
isMethodTaggedWith ( string $className, string $methodName, string $tag ) : boolean Tells if the specified method is tagged with the given tag
isPropertyAnnotatedWith ( string $className, string $propertyName, string $annotationClassName ) : boolean Tells if the specified property has the given annotation
isPropertyPrivate ( string $className, string $propertyName ) : boolean Tells if the specified property is private
isPropertyTaggedWith ( string $className, string $propertyName, string $tag ) : boolean Tells if the specified class property is tagged with the given tag
reflectClassProperty ( string $className, PropertyReflection $property ) : integer
saveToCache ( ) : void Exports the internal reflection data into the ReflectionData cache
setClassSchemataRuntimeCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void Sets the dedicated class schema cache for runtime purposes
setReflectionDataCompiletimeCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void Sets the compile-time data cache
setReflectionDataRuntimeCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void Sets the runtime data cache
setStatusCache ( StringFrontend $cache ) : void Sets the status cache
unfreezePackageReflection ( string $packageKey ) : void Removes the precompiled reflection data of a frozen package

Protected Methods

Method Description
addImplementedInterface ( string $className, ClassReflection $interface )
addParentClass ( string $className, ClassReflection $parentClass ) : void
addPropertiesToClassSchema ( ClassSchema $classSchema ) : void Adds properties of the class at hand to the class schema.
buildClassSchema ( string $className ) : ClassSchema Builds a class schema for the given class name.
buildClassSchemata ( array $classNames ) : void Builds class schemata from classes annotated as entities or value objects
checkValueObjectRequirements ( string $className ) : void Checks if the given class meets the requirements for a value object, i.e.
cleanClassName ( string $className ) : string Clean a given class name from possibly prefixed backslash
completeRepositoryAssignments ( ) : void Complete repository-to-entity assignments.
convertParameterDataToArray ( array $parametersInformation ) : array Converts the internal, optimized data structure of parameter information into a human-friendly array with speaking indexes.
convertParameterReflectionToArray ( ParameterReflection $parameter, MethodReflection $method = null ) : array Converts the given parameter reflection into an information array
ensureAggregateRootInheritanceChainConsistency ( ) : void Checks whether all aggregate roots having superclasses have a repository assigned up to the tip of their hierarchy.
evaluateClassPropertyAnnotationsForSchema ( ClassSchema $classSchema, string $propertyName ) : boolean
expandType ( ClassReflection $class, string $type ) : string Expand shortened class names in "var" and "param" annotations, taking use statements into account.
filterArrayByClassesInNamespace ( array $array, string $packageNamespace ) : array Filter an array of entries were keys are class names by being in the given package namespace.
forgetChangedClasses ( ) : void Checks which classes lack a cache entry and removes their reflection data accordingly.
forgetClass ( string $className ) : void Forgets all reflection data related to the specified class
getDoctrinePhpParser ( ) : Doctrine\Common\Annotations\PhpParser Retrieves a singleton instance of the Doctrine PhpParser
getParentClasses ( ClassReflection $class, array $parentClasses = [] ) : array Finds all parent classes of the given class
getPrecompiledReflectionStoragePath ( ) : string Determines the path to the precompiled reflection data.
hasFrozenCacheInProduction ( ) : boolean
initialize ( ) : void Initialize the reflection service lazily
isTagIgnored ( string $tagName ) : boolean Check if a specific annotation tag is configured to be ignored.
loadClassReflectionCompiletimeCache ( ) : boolean Tries to load the reflection data from the compile time cache.
loadOrReflectClassIfNecessary ( string $className ) : void Loads reflection data from the cache or reflects the class if needed.
log ( string $message, integer $severity = LOG_INFO, mixed $additionalData = null ) : void Writes the given message along with the additional information into the log.
makeChildClassesAggregateRoot ( ClassSchema $classSchema ) : void Assigns the repository of any aggregate root to all it's subclasses, unless they are aggregate root already.
prepareClassReflectionForUsage ( string $className ) : string Initializes the ReflectionService, cleans the given class name and finally reflects the class if necessary.
produceCacheIdentifierFromClassName ( string $className ) : string Transform backslashes to underscores to provide an valid cache identifier.
reflectClass ( string $className ) : void Reflects the given class and stores the results in this service's properties.
reflectClassMethod ( string $className, MethodReflection $method ) : void
reflectClassMethodParameter ( string $className, MethodReflection $method, ParameterReflection $parameter ) : void
reflectEmergedClasses ( ) : void 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.
reflectPropertyTag ( string $className, PropertyReflection $property, string $tagName, array $tagValues ) : array
saveDevelopmentData ( ) Save reflection data to cache in Development context.
saveProductionData ( ) Save reflection data to cache in Production context.
updateReflectionData ( ) Set updated reflection data to caches.

Method Details

addImplementedInterface() protected method

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

addParentClass() protected method

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

addPropertiesToClassSchema() protected method

Properties will be added if they have a var annotation && (!transient-annotation && !inject-annotation) Invalid annotations will cause an exception to be thrown.
protected addPropertiesToClassSchema ( ClassSchema $classSchema ) : void
$classSchema ClassSchema
return void

buildClassSchema() protected method

Builds a class schema for the given class name.
protected buildClassSchema ( string $className ) : ClassSchema
$className string
return ClassSchema

buildClassSchemata() protected method

Builds class schemata from classes annotated as entities or value objects
protected buildClassSchemata ( array $classNames ) : void
$classNames array
return void

buildReflectionData() public method

This method is called by the CompiletimeObjectManager which also determines the list of classes to consider for reflection.
public buildReflectionData ( array $availableClassNames ) : void
$availableClassNames array List of all class names to consider for reflection
return void

checkValueObjectRequirements() protected method

does have a constructor and does not have any setter methods.
protected checkValueObjectRequirements ( string $className ) : void
$className string
return void

cleanClassName() protected method

Clean a given class name from possibly prefixed backslash
protected cleanClassName ( string $className ) : string
$className string
return string

completeRepositoryAssignments() protected method

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 completeRepositoryAssignments ( ) : void
return void

convertParameterDataToArray() protected method

Converts the internal, optimized data structure of parameter information into a human-friendly array with speaking indexes.
protected convertParameterDataToArray ( array $parametersInformation ) : array
$parametersInformation array Raw, internal parameter information
return array Developer friendly version

convertParameterReflectionToArray() protected method

Converts the given parameter reflection into an information array
protected convertParameterReflectionToArray ( ParameterReflection $parameter, MethodReflection $method = null ) : array
$parameter ParameterReflection The parameter to reflect
$method MethodReflection The parameter's method
return array Parameter information array

ensureAggregateRootInheritanceChainConsistency() protected method

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

evaluateClassPropertyAnnotationsForSchema() protected method

protected evaluateClassPropertyAnnotationsForSchema ( ClassSchema $classSchema, string $propertyName ) : boolean
$classSchema ClassSchema
$propertyName string
return boolean

expandType() protected method

Expand shortened class names in "var" and "param" annotations, taking use statements into account.
protected expandType ( ClassReflection $class, string $type ) : string
$class ClassReflection
$type string the type inside var/param annotation
return string the possibly expanded type

filterArrayByClassesInNamespace() protected method

Filter an array of entries were keys are class names by being in the given package namespace.
protected filterArrayByClassesInNamespace ( array $array, string $packageNamespace ) : array
$array array
$packageNamespace string
return array

forgetChangedClasses() protected method

Checks which classes lack a cache entry and removes their reflection data accordingly.
protected forgetChangedClasses ( ) : void
return void

forgetClass() protected method

Forgets all reflection data related to the specified class
protected forgetClass ( string $className ) : void
$className string Name of the class to forget
return void

freezePackageReflection() public method

This method is used by the package manager.
public freezePackageReflection ( string $packageKey ) : void
$packageKey string
return void

getAllClassNames() public method

Returns the names of all classes known to this reflection service.
public getAllClassNames ( ) : array
return array Class names

getAllImplementationClassNamesForInterface() public method

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.
public getAllImplementationClassNamesForInterface ( string $interfaceName ) : array
$interfaceName string Name of the interface
return array An array of class names of the default implementation for the object type

getAllSubClassNamesForClass() public method

If no class inheriting the given class was found, an empty array is returned.
public getAllSubClassNamesForClass ( string $className ) : array
$className string Name of the parent class
return array An array of names of those classes being a direct or indirect subclass of the specified class

getClassAnnotation() public method

If multiple annotations are set on the target you will get one (random) instance of them.
public getClassAnnotation ( string $className, string $annotationClassName ) : object
$className string Name of the class
$annotationClassName string Annotation to filter for
return object

getClassAnnotations() public method

Returns the specified class annotations or an empty array
public getClassAnnotations ( string $className, string $annotationClassName = null ) : array
$className string Name of the class
$annotationClassName string Annotation to filter for
return array

getClassNameByObject() public method

Returns the class name of the given object. This is a convenience method that returns the expected class names even for proxy classes.
Deprecation: since 3.0 use \Neos\Utility\TypeHandling::getTypeForValue() instead
public getClassNameByObject ( object $object ) : string
$object object
return string The class name of the given object

getClassNamesByAnnotation() public method

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.
public getClassNamesByAnnotation ( string $annotationClassName ) : array
$annotationClassName string Name of the annotation class, for example "Neos\Flow\Annotations\Aspect"
return array

getClassPropertyNames() public method

Returns the names of all properties of the specified class
public getClassPropertyNames ( string $className ) : array
$className string Name of the class to return the property names of
return array An array of property names or an empty array if none exist

getClassSchema() public method

Returns the class schema for the given class
public getClassSchema ( mixed $classNameOrObject ) : ClassSchema
$classNameOrObject mixed The class name or an object
return ClassSchema

getClassesContainingMethodsAnnotatedWith() public method

Returns all class names of classes containing at least one method annotated with the given annotation class
public getClassesContainingMethodsAnnotatedWith ( string $annotationClassName ) : array
$annotationClassName string The annotation class name for a method annotation
return array An array of class names

getDefaultImplementationClassNameForInterface() public method

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.
public getDefaultImplementationClassNameForInterface ( string $interfaceName ) : mixed
$interfaceName string Name of the interface
return mixed Either the class name of the default implementation for the object type or FALSE

getDoctrinePhpParser() protected method

Retrieves a singleton instance of the Doctrine PhpParser
protected getDoctrinePhpParser ( ) : Doctrine\Common\Annotations\PhpParser
return Doctrine\Common\Annotations\PhpParser

getMethodAnnotation() public method

If multiple annotations are set on the target you will get one (random) instance of them.
public getMethodAnnotation ( string $className, string $methodName, string $annotationClassName ) : object
$className string Name of the class
$methodName string Name of the method
$annotationClassName string Annotation to filter for
return object

getMethodAnnotations() public method

Returns the specified method annotations or an empty array
public getMethodAnnotations ( string $className, string $methodName, string $annotationClassName = null ) : array
$className string Name of the class
$methodName string Name of the method
$annotationClassName string Annotation to filter for
return array

getMethodDeclaredReturnType() public method

Returns the declared return type of a method (for PHP < 7.0 this will always return null)
public getMethodDeclaredReturnType ( string $className, string $methodName ) : string
$className string
$methodName string
return string The declared return type of the method or null if none was declared

getMethodParameters() public method

Returns an array of parameters of the given method. Each entry contains additional information about the parameter position, type hint etc.
public getMethodParameters ( string $className, string $methodName ) : array
$className string Name of the class containing the method
$methodName string Name of the method to return parameter information of
return array An array of parameter names and additional information or an empty array of no parameters were found

getMethodTagsValues() public method

Returns all tags and their values the specified method is tagged with
public getMethodTagsValues ( string $className, string $methodName ) : array
$className string Name of the class containing the method
$methodName string Name of the method to return the tags and values of
return array An array of tags and their values or an empty array of no tags were found

getMethodsAnnotatedWith() public method

Returns all names of methods of the given class that are annotated with the given annotation class
public getMethodsAnnotatedWith ( string $className, string $annotationClassName ) : array
$className string Name of the class containing the method(s)
$annotationClassName string The annotation class name for a method annotation
return array An array of method names

getParentClasses() protected method

Finds all parent classes of the given class
protected getParentClasses ( ClassReflection $class, array $parentClasses = [] ) : array
$class ClassReflection The class to reflect
$parentClasses array Array of parent classes
return array

getPrecompiledReflectionStoragePath() protected method

Determines the path to the precompiled reflection data.

getPropertyAnnotation() public method

If multiple annotations are set on the target you will get one (random) instance of them.
public getPropertyAnnotation ( string $className, string $propertyName, string $annotationClassName ) : object
$className string Name of the class
$propertyName string Name of the property
$annotationClassName string Annotation to filter for
return object

getPropertyAnnotations() public method

Returns the specified property annotations or an empty array
public getPropertyAnnotations ( string $className, string $propertyName, string $annotationClassName = null ) : array
$className string Name of the class
$propertyName string Name of the property
$annotationClassName string Annotation to filter for
return array

getPropertyNamesByAnnotation() public method

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.
public getPropertyNamesByAnnotation ( string $className, string $annotationClassName ) : array
$className string Name of the class containing the properties
$annotationClassName string Class name of the annotation to search for
return array An array of property names carrying the annotation

getPropertyNamesByTag() public method

If no properties were found, an empty array is returned.
public getPropertyNamesByTag ( string $className, string $tag ) : array
$className string Name of the class containing the properties
$tag string Tag to search for
return array An array of property names tagged by the tag

getPropertyTagValues() public method

Returns the values of the specified class property tag
public getPropertyTagValues ( string $className, string $propertyName, string $tag ) : array
$className string Name of the class containing the property
$propertyName string Name of the tagged property
$tag string Tag to return the values of
return array An array of values or an empty array if the tag was not found

getPropertyTagsValues() public method

Returns all tags and their values the specified class property is tagged with
public getPropertyTagsValues ( string $className, string $propertyName ) : array
$className string Name of the class containing the property
$propertyName string Name of the property to return the tags and values of
return array An array of tags and their values or an empty array of no tags were found

hasFrozenCacheInProduction() protected method

protected hasFrozenCacheInProduction ( ) : boolean
return boolean

hasMethod() public method

Wrapper for method_exists() which tells if the given method exists.
public hasMethod ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method
return boolean

initialize() protected method

This method must be run only after all dependencies have been injected.
protected initialize ( ) : void
return void

injectClassLoader() public method

public injectClassLoader ( ClassLoader $classLoader ) : void
$classLoader Neos\Flow\Core\ClassLoader
return void

injectEnvironment() public method

public injectEnvironment ( Environment $environment ) : void
$environment Neos\Flow\Utility\Environment
return void

injectPackageManager() public method

public injectPackageManager ( Neos\Flow\Package\PackageManagerInterface $packageManager ) : void
$packageManager Neos\Flow\Package\PackageManagerInterface
return void

injectSettings() public method

public injectSettings ( array $settings ) : void
$settings array Settings of the Flow package
return void

injectSystemLogger() public method

public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
return void

isClassAbstract() public method

Tells if the specified class is abstract or not
public isClassAbstract ( string $className ) : boolean
$className string Name of the class to analyze
return boolean TRUE if the class is abstract, otherwise FALSE

isClassAnnotatedWith() public method

Tells if the specified class has the given annotation
public isClassAnnotatedWith ( string $className, string $annotationClassName ) : boolean
$className string Name of the class
$annotationClassName string Annotation to check for
return boolean

isClassFinal() public method

Tells if the specified class is final or not
public isClassFinal ( string $className ) : boolean
$className string Name of the class to analyze
return boolean TRUE if the class is final, otherwise FALSE

isClassImplementationOf() public method

Tells if the specified class implements the given interface
public isClassImplementationOf ( string $className, string $interfaceName ) : boolean
$className string Name of the class
$interfaceName string interface to check for
return boolean TRUE if the class implements $interfaceName, otherwise FALSE

isClassReflected() public method

Tells if the specified class is known to this reflection service and reflection information is available.
public isClassReflected ( string $className ) : boolean
$className string Name of the class
return boolean If the class is reflected by this service

isClassUnconfigurable() public method

Tells if the class is unconfigurable or not
public isClassUnconfigurable ( string $className ) : boolean
$className string Name of the class to analyze
return boolean return TRUE if class not could not be automatically configured, otherwise FALSE

isMethodAnnotatedWith() public method

Tells if the specified method has the given annotation
public isMethodAnnotatedWith ( string $className, string $methodName, string $annotationClassName ) : boolean
$className string Name of the class
$methodName string Name of the method
$annotationClassName string Annotation to check for
return boolean

isMethodFinal() public method

Tells if the specified method is final or not
public isMethodFinal ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
return boolean TRUE if the method is final, otherwise FALSE

isMethodPrivate() public method

Tells if the specified method is private
public isMethodPrivate ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
return boolean TRUE if the method is private, otherwise FALSE

isMethodProtected() public method

Tells if the specified method is protected
public isMethodProtected ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
return boolean TRUE if the method is protected, otherwise FALSE

isMethodPublic() public method

Tells if the specified method is public
public isMethodPublic ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
return boolean TRUE if the method is public, otherwise FALSE

isMethodStatic() public method

Tells if the specified method is declared as static or not
public isMethodStatic ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
return boolean TRUE if the method is static, otherwise FALSE

isMethodTaggedWith() public method

Tells if the specified method is tagged with the given tag
public isMethodTaggedWith ( string $className, string $methodName, string $tag ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
$tag string Tag to check for
return boolean TRUE if the method is tagged with $tag, otherwise FALSE

isPropertyAnnotatedWith() public method

Tells if the specified property has the given annotation
public isPropertyAnnotatedWith ( string $className, string $propertyName, string $annotationClassName ) : boolean
$className string Name of the class
$propertyName string Name of the method
$annotationClassName string Annotation to check for
return boolean

isPropertyPrivate() public method

Tells if the specified property is private
public isPropertyPrivate ( string $className, string $propertyName ) : boolean
$className string Name of the class containing the method
$propertyName string Name of the property to analyze
return boolean TRUE if the property is private, otherwise FALSE

isPropertyTaggedWith() public method

Tells if the specified class property is tagged with the given tag
public isPropertyTaggedWith ( string $className, string $propertyName, string $tag ) : boolean
$className string Name of the class
$propertyName string Name of the property
$tag string Tag to check for
return boolean TRUE if the class property is tagged with $tag, otherwise FALSE

isTagIgnored() protected method

Check if a specific annotation tag is configured to be ignored.
protected isTagIgnored ( string $tagName ) : boolean
$tagName string The annotation tag to check
return boolean TRUE if the tag is configured to be ignored, FALSE otherwise

loadClassReflectionCompiletimeCache() protected method

The compile time cache is only supported for Development context and thus this function will return in any other context. If no reflection data was found, this method will at least load the precompiled reflection data of any possible frozen package. Even if precompiled reflection data could be loaded, FALSE will be returned in order to signal that other packages still need to be reflected.
protected loadClassReflectionCompiletimeCache ( ) : boolean
return boolean TRUE if reflection data could be loaded, otherwise FALSE

loadOrReflectClassIfNecessary() protected method

If the class is completely unknown, this method won't try to load or reflect it. If it is known and reflection data has been loaded already, it won't be loaded again. In Production context, with frozen caches, this method will load reflection data for the specified class from the runtime cache.
protected loadOrReflectClassIfNecessary ( string $className ) : void
$className string Name of the class to load data for
return void

log() protected method

Writes the given message along with the additional information into the log.
protected log ( string $message, integer $severity = LOG_INFO, mixed $additionalData = null ) : void
$message string The message to log
$severity integer An integer value, one of the LOG_* constants
$additionalData mixed A variable containing more information about the event to be logged
return void

makeChildClassesAggregateRoot() protected method

Assigns the repository of any aggregate root to all it's subclasses, unless they are aggregate root already.
protected makeChildClassesAggregateRoot ( ClassSchema $classSchema ) : void
$classSchema ClassSchema
return void

prepareClassReflectionForUsage() protected method

Initializes the ReflectionService, cleans the given class name and finally reflects the class if necessary.
protected prepareClassReflectionForUsage ( string $className ) : string
$className string
return string The cleaned class name

produceCacheIdentifierFromClassName() protected method

Transform backslashes to underscores to provide an valid cache identifier.
protected produceCacheIdentifierFromClassName ( string $className ) : string
$className string
return string

reflectClass() protected method

Reflects the given class and stores the results in this service's properties.
protected reflectClass ( string $className ) : void
$className string Full qualified name of the class to reflect
return void

reflectClassMethod() protected method

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

reflectClassMethodParameter() protected method

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

reflectClassProperty() public method

public reflectClassProperty ( string $className, PropertyReflection $property ) : integer
$className string
$property PropertyReflection
return integer visibility

reflectEmergedClasses() protected method

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 reflectEmergedClasses ( ) : void
return void

reflectPropertyTag() protected method

protected reflectPropertyTag ( string $className, PropertyReflection $property, string $tagName, array $tagValues ) : array
$className string
$property PropertyReflection
$tagName string
$tagValues array
return array

saveDevelopmentData() protected method

Save reflection data to cache in Development context.
protected saveDevelopmentData ( )

saveProductionData() protected method

Save reflection data to cache in Production context.
protected saveProductionData ( )

saveToCache() public method

This method is triggered by a signal which is connected to the bootstrap's shutdown sequence. If the reflection data has previously been loaded from the runtime cache, saving it is omitted as changes are not expected. In Production context the whole cache is written at once and then frozen in order to be consistent. Frozen cache data in Development is only produced for classes contained in frozen packages.
public saveToCache ( ) : void
return void

setClassSchemataRuntimeCache() public method

Sets the dedicated class schema cache for runtime purposes
public setClassSchemataRuntimeCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void
$cache Neos\Cache\Frontend\VariableFrontend
return void

setReflectionDataCompiletimeCache() public method

Sets the compile-time data cache
public setReflectionDataCompiletimeCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void
$cache Neos\Cache\Frontend\VariableFrontend Cache for the reflection service
return void

setReflectionDataRuntimeCache() public method

Sets the runtime data cache
public setReflectionDataRuntimeCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void
$cache Neos\Cache\Frontend\VariableFrontend Cache for the reflection service
return void

setStatusCache() public method

The cache must be set before initializing the Reflection Service
public setStatusCache ( StringFrontend $cache ) : void
$cache Neos\Cache\Frontend\StringFrontend Cache for the reflection service
return void

unfreezePackageReflection() public method

This method is used by the package manager.
public unfreezePackageReflection ( string $packageKey ) : void
$packageKey string The package to remove the data from
return void

updateReflectionData() protected method

Set updated reflection data to caches.
protected updateReflectionData ( )

Property Details

$annotatedClasses protected property

Array of annotation classnames and the names of classes which are annotated with them
protected array $annotatedClasses
return array

$annotationReader protected property

protected Reader,Doctrine\Common\Annotations $annotationReader
return Doctrine\Common\Annotations\Reader

$availableClassNames protected property

protected array $availableClassNames
return array

$classLoader protected property

protected ClassLoader,Neos\Flow\Core $classLoader
return Neos\Flow\Core\ClassLoader

$classReflectionData protected property

Array with reflection information indexed by class name
protected array $classReflectionData
return array

$classSchemata protected property

Schemata of all classes which can be persisted
protected array<\Neos\Flow\Reflection\ClassSchema> $classSchemata
return array<\Neos\Flow\Reflection\ClassSchema>

$classSchemataRuntimeCache protected property

protected VariableFrontend,Neos\Cache\Frontend $classSchemataRuntimeCache
return Neos\Cache\Frontend\VariableFrontend

$classesByMethodAnnotations protected property

Array of method annotations and the classes and methods which are annotated with them
protected array $classesByMethodAnnotations
return array

$classesCurrentlyBeingForgotten protected property

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

$context protected property

protected ApplicationContext,Neos\Flow\Core $context
return Neos\Flow\Core\ApplicationContext

$doctrinePhpParser protected property

Note: Don't refer to this member directly but use getDoctrinePhpParser() to obtain an instance
protected PhpParser,Doctrine\Common\Annotations $doctrinePhpParser
return Doctrine\Common\Annotations\PhpParser

$environment protected property

protected Environment,Neos\Flow\Utility $environment
return Neos\Flow\Utility\Environment

$initialized protected property

protected bool $initialized
return boolean

$loadFromClassSchemaRuntimeCache protected property

In Production context, with frozen caches, this flag will be TRUE
protected bool $loadFromClassSchemaRuntimeCache
return boolean

$packageManager protected property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface

$reflectionDataCompiletimeCache protected property

protected VariableFrontend,Neos\Cache\Frontend $reflectionDataCompiletimeCache
return Neos\Cache\Frontend\VariableFrontend

$reflectionDataRuntimeCache protected property

protected VariableFrontend,Neos\Cache\Frontend $reflectionDataRuntimeCache
return Neos\Cache\Frontend\VariableFrontend

$settings protected property

protected array $settings
return array

$statusCache protected property

protected StringFrontend,Neos\Cache\Frontend $statusCache
return Neos\Cache\Frontend\StringFrontend

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface

$updatedReflectionData protected property

Array with updated reflection information (e.g. in Development context after classes have changed)
protected array $updatedReflectionData
return array

$useStatementsForClassCache protected property

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