[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/zendframework/zend-code/src/Scanner/ -> FileScanner.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-2015 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\Annotation\AnnotationManager;
  13  use Zend\Code\Exception;
  14  
  15  class FileScanner extends TokenArrayScanner implements ScannerInterface
  16  {
  17      /**
  18       * @var string
  19       */
  20      protected $file = null;
  21  
  22      /**
  23       * @param  string $file
  24       * @param  null|AnnotationManager $annotationManager
  25       * @throws Exception\InvalidArgumentException
  26       */
  27      public function __construct($file, AnnotationManager $annotationManager = null)
  28      {
  29          $this->file = $file;
  30          if (!file_exists($file)) {
  31              throw new Exception\InvalidArgumentException(sprintf(
  32                  'File "%s" not found',
  33                  $file
  34              ));
  35          }
  36          parent::__construct(token_get_all(file_get_contents($file)), $annotationManager);
  37      }
  38  
  39      /**
  40       * @return string
  41       */
  42      public function getFile()
  43      {
  44          return $this->file;
  45      }
  46  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1