ApiGen\Parser\Elements\ElementStorage::getElements PHP Метод

getElements() публичный метод

public getElements ( )
    public function getElements()
    {
        $this->ensureCategorization();
        $elements = [Elements::CLASSES => $this->classes, Elements::CONSTANTS => $this->constants, Elements::FUNCTIONS => $this->functions, Elements::INTERFACES => $this->interfaces, Elements::TRAITS => $this->traits, Elements::EXCEPTIONS => $this->exceptions];
        return $elements;
    }

Usage Example

 /**
  * @param string $annotation
  * @param callable $skipClassCallback
  * @return array[]
  */
 public function extractElementsByAnnotation($annotation, callable $skipClassCallback = NULL)
 {
     $elements = $this->elements->getEmptyList();
     $elements[Elements::METHODS] = [];
     $elements[Elements::PROPERTIES] = [];
     foreach ($this->elementStorage->getElements() as $type => $elementList) {
         $elementsForMain = $this->elementFilter->filterForMain($elementList);
         $elements[$type] += $this->elementFilter->filterByAnnotation($elementsForMain, $annotation);
         if ($type === Elements::CONSTANTS || $type === Elements::FUNCTIONS) {
             continue;
         }
         foreach ($elementList as $class) {
             /** @var ReflectionClass $class */
             if (!$class->isMain()) {
                 continue;
             }
             if ($skipClassCallback && $skipClassCallback($class)) {
                 // in case when class is prior to it's elements
                 continue;
             }
             $elements[Elements::METHODS] = $this->extractByAnnotationAndMerge($class->getOwnMethods(), $annotation, $elements[Elements::METHODS]);
             $elements[Elements::CONSTANTS] = $this->extractByAnnotationAndMerge($class->getOwnConstants(), $annotation, $elements[Elements::CONSTANTS]);
             $elements[Elements::PROPERTIES] = $this->extractByAnnotationAndMerge($class->getOwnProperties(), $annotation, $elements[Elements::PROPERTIES]);
         }
     }
     return $this->sortElements($elements);
 }
All Usage Examples Of ApiGen\Parser\Elements\ElementStorage::getElements