Exemplo n.º 1
0
 /**
  * Generate the XML Schema for a given class name.
  *
  * @param string $className Class name to generate the schema for.
  * @param string $namespace Namespace prefix. Used to split off the first parts of the class name.
  * @param SimpleXMLElement $xmlRootNode XML root node where the xsd:element is appended.
  * @return void
  */
 protected function generateXmlForClassName($className, $namespace, \SimpleXMLElement $xmlRootNode)
 {
     $reflectionClass = new \TYPO3\Fluid\Reflection\ClassReflection($className);
     if (!$reflectionClass->isSubclassOf($this->abstractViewHelperReflectionClass)) {
         return;
     }
     $tagName = $this->getTagNameForClass($className, $namespace);
     $docbookSection = $xmlRootNode->addChild('section');
     $docbookSection->addChild('title', $tagName);
     $this->docCommentParser->parseDocComment($reflectionClass->getDocComment());
     $this->addDocumentation($this->docCommentParser->getDescription(), $docbookSection);
     $argumentsSection = $docbookSection->addChild('section');
     $argumentsSection->addChild('title', 'Arguments');
     $this->addArguments($className, $argumentsSection);
     return $docbookSection;
 }
Exemplo n.º 2
0
 /**
  * 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 \TYPO3\Fluid\Reflection\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;
 }