/** * 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 * @author Robert Lemke <*****@*****.**> */ protected function reflectClass($className) { $this->log('Reflecting class "' . $className . '" (' . ($this->initialized ? '' : 'not ') . 'initialized)', LOG_DEBUG); $class = new \F3\FLOW3\Reflection\ClassReflection($className); $this->reflectedClassNames[$className] = time(); if ($class->isAbstract()) { $this->abstractClasses[$className] = TRUE; } if ($class->isFinal()) { $this->finalClasses[$className] = TRUE; } $constructor = $class->getConstructor(); if ($constructor instanceof \ReflectionMethod) { $this->classConstructorMethodNames[$className] = $constructor->getName(); } foreach ($this->getParentClasses($class) as $parentClass) { $this->subClasses[$parentClass->getName()][$className] = TRUE; } foreach ($class->getInterfaces() as $interface) { if (!isset($this->abstractClasses[$className])) { $this->interfaceImplementations[$interface->getName()][] = $className; } } 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(); if ($method->isFinal()) { $this->finalMethods[$className . '::' . $methodName] = TRUE; } if ($method->isStatic()) { $this->staticMethods[$className . '::' . $methodName] = TRUE; } if ($method->isPublic()) { $this->methodVisibilities[$className][$methodName] = ' '; } if ($method->isProtected()) { $this->methodVisibilities[$className][$methodName] = '*'; } if ($method->isPrivate()) { $this->methodVisibilities[$className][$methodName] = '-'; } foreach ($method->getTagsValues() as $tag => $values) { if (array_search($tag, $this->ignoredTags) === FALSE) { $this->methodTagsValues[$className][$methodName][$tag] = $values; } } foreach ($method->getParameters() as $parameter) { $this->methodParameters[$className][$methodName][$parameter->getName()] = $this->convertParameterReflectionToArray($parameter, $method); if (isset($this->methodTagsValues[$className][$methodName]['param'][$parameter->getPosition()])) { $parameterAnnotation = explode(' ', $this->methodTagsValues[$className][$methodName]['param'][$parameter->getPosition()], 3); if (count($parameterAnnotation) < 2) { $this->log(' Wrong @param use for "' . $method->getName() . '::' . $parameter->getName() . '": "' . implode(' ', $parameterAnnotation) . '"', LOG_DEBUG); } else { if (isset($this->methodParameters[$className][$methodName][$parameter->getName()]['type']) && $this->methodParameters[$className][$methodName][$parameter->getName()]['type'] !== ltrim($parameterAnnotation[0], '\\')) { $this->log(' Wrong type in @param for "' . $method->getName() . '::' . $parameter->getName() . '": "' . $parameterAnnotation[0] . '"', LOG_DEBUG); } if ($parameter->getName() !== ltrim($parameterAnnotation[1], '$&')) { $this->log(' Wrong name in @param for "' . $method->getName() . '::$' . $parameter->getName() . '": "' . $parameterAnnotation[1] . '"', LOG_DEBUG); } } } } } ksort($this->reflectedClassNames); }