-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Core\Configuration\Option; | ||
use Rector\Core\ValueObject\PhpVersion; | ||
use Rector\Set\ValueObject\SetList; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
// get parameters | ||
$parameters = $containerConfigurator->parameters(); | ||
|
||
// paths to refactor; solid alternative to CLI arguments | ||
$parameters->set(Option::PATHS, [ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests' | ||
]); | ||
|
||
// is your PHP version different from the one your refactor to? [default: your PHP version], uses PHP_VERSION_ID format | ||
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_72); | ||
|
||
// Define what rule sets will be applied | ||
$containerConfigurator->import(SetList::CODE_QUALITY); | ||
|
||
// Path to phpstan with extensions, that PHPSTan in Rector uses to determine types | ||
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, getcwd() . '/phpstan.neon.dist'); | ||
}; |