RectorConfigFilePathHelper: remove unneded static

This commit is contained in:
TomasVotruba 2017-11-05 20:33:27 +01:00
parent 25a2f1b806
commit ab3b3d1148
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ require_once __DIR__ . '/rector_bootstrap.php';
try {
// 1. Detect configuration from --level
$configFile = RectorConfigFilePathHelper::resolveLevel(new ArgvInput);
$configFile = (new RectorConfigFilePathHelper)->resolveLevel(new ArgvInput);
// 2. Or from --config
if ($configFile === null) {

View File

@ -16,9 +16,9 @@ final class RectorConfigFilePathHelper
/**
* @var string
*/
private static $levelDirectory = __DIR__ . '/../config/level';
private $levelDirectory = __DIR__ . '/../config/level';
public static function resolveLevel(InputInterface $input): ?string
public function resolveLevel(InputInterface $input): ?string
{
if (! $input->hasParameterOption(self::LEVEL_OPTION_NAME)) {
return null;
@ -29,7 +29,7 @@ final class RectorConfigFilePathHelper
$finder = Finder::create()
->files()
->name($levelConfigName . '.yml')
->in(self::$levelDirectory);
->in($this->levelDirectory);
$firstFile = self::getFirstFileFromFinder($finder);
if (! $firstFile) {
@ -39,7 +39,7 @@ final class RectorConfigFilePathHelper
return $firstFile->getRealPath();
}
private static function getFirstFileFromFinder(Finder $finder): ?SplFileInfo
private function getFirstFileFromFinder(Finder $finder): ?SplFileInfo
{
$iterator = $finder->getIterator();
$iterator->rewind();