/** * 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(); } } }
/** * @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; }
/** * @return string[] */ private function _getAllStandardNames() { $result = []; $ymlFiles = $this->fileSystem->getAllFiles($this->_getStandardsFolder(), '/\\.yml$/'); foreach ($ymlFiles as $ymlFilePath) { $result[] = basename($ymlFilePath, '.yml'); } return $result; }
/** * Defined by ReportInterface. * * @see ReportInterface::finish() */ public function finish() { $this->writer->endElement(); $this->writer->endDocument(); $this->fileSystem->putContent($this->filename, $this->writer->outputMemory()); }