[ Index ]

PHP Cross Reference of phpBB-3.3.12-deutsch

title

Body

[close]

/vendor/zendframework/zend-code/src/Scanner/ -> AggregateDirectoryScanner.php (source)

   1  <?php
   2  /**
   3   * Zend Framework (http://framework.zend.com/)
   4   *
   5   * @link      http://github.com/zendframework/zf2 for the canonical source repository
   6   * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
   7   * @license   http://framework.zend.com/license/new-bsd New BSD License
   8   */
   9  
  10  namespace Zend\Code\Scanner;
  11  
  12  use Zend\Code\Exception;
  13  
  14  class AggregateDirectoryScanner extends DirectoryScanner
  15  {
  16      /**
  17       * @var bool
  18       */
  19      protected $isScanned = false;
  20  
  21      /**
  22       * @param  bool $returnScannerClass
  23       * @todo not implemented
  24       */
  25      public function getNamespaces($returnScannerClass = false)
  26      {
  27          // @todo
  28      }
  29  
  30      public function getIncludes($returnScannerClass = false)
  31      {
  32      }
  33  
  34      public function getClasses($returnScannerClass = false, $returnDerivedScannerClass = false)
  35      {
  36          $classes = [];
  37          foreach ($this->directories as $scanner) {
  38              $classes += $scanner->getClasses();
  39          }
  40          if ($returnScannerClass) {
  41              foreach ($classes as $index => $class) {
  42                  $classes[$index] = $this->getClass($class, $returnScannerClass, $returnDerivedScannerClass);
  43              }
  44          }
  45  
  46          return $classes;
  47      }
  48  
  49      /**
  50       * @param  string $class
  51       * @return bool
  52       */
  53      public function hasClass($class)
  54      {
  55          foreach ($this->directories as $scanner) {
  56              if ($scanner->hasClass($class)) {
  57                  break;
  58              } else {
  59                  unset($scanner);
  60              }
  61          }
  62  
  63          return isset($scanner);
  64      }
  65  
  66      /**
  67       * @param  string $class
  68       * @param  bool $returnScannerClass
  69       * @param  bool $returnDerivedScannerClass
  70       * @return ClassScanner|DerivedClassScanner
  71       * @throws Exception\RuntimeException
  72       */
  73      public function getClass($class, $returnScannerClass = true, $returnDerivedScannerClass = false)
  74      {
  75          foreach ($this->directories as $scanner) {
  76              if ($scanner->hasClass($class)) {
  77                  break;
  78              } else {
  79                  unset($scanner);
  80              }
  81          }
  82  
  83          if (! isset($scanner)) {
  84              throw new Exception\RuntimeException('Class by that name was not found.');
  85          }
  86  
  87          $classScanner = $scanner->getClass($class);
  88  
  89          return new DerivedClassScanner($classScanner, $this);
  90      }
  91  
  92      /**
  93       * @param bool $returnScannerClass
  94       */
  95      public function getFunctions($returnScannerClass = false)
  96      {
  97          $this->scan();
  98  
  99          if (! $returnScannerClass) {
 100              $functions = [];
 101              foreach ($this->infos as $info) {
 102                  if ($info['type'] == 'function') {
 103                      $functions[] = $info['name'];
 104                  }
 105              }
 106  
 107              return $functions;
 108          }
 109          $scannerClass = new FunctionScanner();
 110          // @todo
 111      }
 112  }


Generated: Sun Jun 23 12:25:44 2024 Cross-referenced by PHPXref 0.7.1