/** * 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[] */ private function checkPathDirectory($path) { $iterator = $this->fileSystem->getAllFiles($path, '/^.+\\.php$/i'); $results = []; foreach ($iterator as $subPath) { $results = array_merge($results, $this->checkPathFile($subPath)); } return $results; }
/** * @return string[] */ private function _getAllStandardNames() { $result = []; $ymlFiles = $this->fileSystem->getAllFiles($this->_getStandardsFolder(), '/\\.yml$/'); foreach ($ymlFiles as $ymlFilePath) { $result[] = basename($ymlFilePath, '.yml'); } return $result; }