mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-15 15:42:22 +00:00
RectorConfigFilePathHelper: remove unneded static
This commit is contained in:
parent
25a2f1b806
commit
ab3b3d1148
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user