コード例 #1
0
ファイル: CheckRepository.php プロジェクト: hippophp/hippo
 /**
  * Builds a list of checks to run.
  */
 private function build()
 {
     foreach ($this->fileSystem->getAllFiles($this->getRootDirectory(), '/^.*\\.php$/') as $filePath) {
         require_once $filePath;
     }
     $this->checks = [];
     foreach (get_declared_classes() as $class) {
         $reflectionClass = new ReflectionClass($class);
         if ($this->canInstantiate($reflectionClass)) {
             $this->checks[] = $reflectionClass->newInstance();
         }
     }
 }
コード例 #2
0
ファイル: CheckRunner.php プロジェクト: hippophp/hippo
 /**
  * @param string $path
  *
  * @return \HippoPHP\Hippo\CheckResult[]
  */
 protected function checkPathFile($path)
 {
     $file = new File($path, $this->fileSystem->getContent($path));
     $checkResults = $this->checkFile($file);
     if ($this->observer !== null) {
         call_user_func($this->observer, $file, $checkResults);
     }
     return $checkResults;
 }
コード例 #3
0
ファイル: HippoTextUI.php プロジェクト: hippophp/hippo
 /**
  * @return string[]
  */
 private function _getAllStandardNames()
 {
     $result = [];
     $ymlFiles = $this->fileSystem->getAllFiles($this->_getStandardsFolder(), '/\\.yml$/');
     foreach ($ymlFiles as $ymlFilePath) {
         $result[] = basename($ymlFilePath, '.yml');
     }
     return $result;
 }
コード例 #4
0
ファイル: CheckstyleReporter.php プロジェクト: hippophp/hippo
 /**
  * Defined by ReportInterface.
  *
  * @see ReportInterface::finish()
  */
 public function finish()
 {
     $this->writer->endElement();
     $this->writer->endDocument();
     $this->fileSystem->putContent($this->filename, $this->writer->outputMemory());
 }