generated from spawnia/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
27 lines (21 loc) · 1.05 KB
/
rector.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php declare(strict_types=1);
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(SetList::CODE_QUALITY);
$containerConfigurator->import(SetList::PHP_71);
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
// skip csv test file to keep `\r` and `\n` for readability
JoinStringConcatRector::class => [
// single file
__DIR__ . '/tests/Unit/CSVArrayTest.php',
],
]);
// paths to refactor; solid alternative to CLI arguments
$parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']);
// Path to phpstan with extensions, that PHPSTan in Rector uses to determine types
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, getcwd() . '/phpstan-for-config.neon');
};