/** * Reflects the given class and stores the results in this service's properties. * * @param string $className Full qualified name of the class to reflect * @return void */ protected function reflectClass($className) { $class = new ClassReflection($className); $this->reflectedClassNames[$className] = time(); foreach ($class->getTagsValues() as $tag => $values) { if (array_search($tag, $this->ignoredTags) === false) { $this->taggedClasses[$tag][] = $className; $this->classTagsValues[$className][$tag] = $values; } } foreach ($class->getProperties() as $property) { $propertyName = $property->getName(); $this->classPropertyNames[$className][] = $propertyName; foreach ($property->getTagsValues() as $tag => $values) { if (array_search($tag, $this->ignoredTags) === false) { $this->propertyTagsValues[$className][$propertyName][$tag] = $values; } } } foreach ($class->getMethods() as $method) { $methodName = $method->getName(); foreach ($method->getTagsValues() as $tag => $values) { if (array_search($tag, $this->ignoredTags) === false) { $this->methodTagsValues[$className][$methodName][$tag] = $values; } } foreach ($method->getParameters() as $parameterPosition => $parameter) { $this->methodParameters[$className][$methodName][$parameter->getName()] = $this->convertParameterReflectionToArray($parameter, $parameterPosition, $method); } } ksort($this->reflectedClassNames); $this->dataCacheNeedsUpdate = true; }
/** * Get the tag configuration from this method and respect multiple line and space configuration * * @param MethodReflection|ClassReflection $reflectionObject * @param array $tagNames * * @return array */ public static function getTagConfiguration($reflectionObject, array $tagNames) { $tags = $reflectionObject->getTagsValues(); $configuration = []; foreach ($tagNames as $tagName) { $configuration[$tagName] = []; if (!is_array($tags[$tagName])) { continue; } foreach ($tags[$tagName] as $c) { $configuration[$tagName] = array_merge($configuration[$tagName], GeneralUtility::trimExplode(' ', $c, true)); } } return $configuration; }