Esempio n. 1
0
 private function categorizeParsedElements()
 {
     foreach ($this->parserStorage->getTypes() as $type) {
         $elements = $this->parserStorage->getElementsByType($type);
         foreach ($elements as $elementName => $element) {
             if (!$element->isDocumented()) {
                 continue;
             }
             if ($element instanceof ConstantReflectionInterface) {
                 $elementType = Elements::CONSTANTS;
                 $this->constants[$elementName] = $element;
             } elseif ($element instanceof FunctionReflectionInterface) {
                 $elementType = Elements::FUNCTIONS;
                 $this->functions[$elementName] = $element;
             } elseif ($element->isInterface()) {
                 $elementType = Elements::INTERFACES;
                 $this->interfaces[$elementName] = $element;
             } elseif ($element->isTrait()) {
                 $elementType = Elements::TRAITS;
                 $this->traits[$elementName] = $element;
             } elseif ($element->isException()) {
                 $elementType = Elements::EXCEPTIONS;
                 $this->exceptions[$elementName] = $element;
             } else {
                 $elementType = Elements::CLASSES;
                 $this->classes[$elementName] = $element;
             }
             $this->categorizeElementToNamespaceAndPackage($elementName, $elementType, $element);
         }
     }
     $this->sortNamespacesAndPackages();
     $this->areElementsCategorized = true;
     $this->addUsedByAnnotation();
 }
Esempio n. 2
0
 /**
  * @return ClassReflectionInterface[]
  */
 public function getParsedClasses()
 {
     return $this->parserResult->getElementsByType(ElementsInterface::CLASSES);
 }