Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@
"roave/psr-container-doctrine": "^3.5"
},
"require-dev": {
"filp/whoops": "^2.14",
"laminas/laminas-development-mode": "^3.10",
"mezzio/mezzio-tooling": "^2.6",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.15.18",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.7",
"filp/whoops": "^2.14",
"vimeo/psalm": "^4.30"
},
"autoload": {
Expand Down
53 changes: 53 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
/**
* @see https://getrector.com/documentation
*
* Run full analysis: vendor/bin/rector process --clear-cache
* Run analysis as simulation: vendor/bin/rector process --dry-run --clear-cache
* Run analysis only on specific directory: vendor/bin/rector process dir1 dir2 dirN --clear-cache
* Get help using Rector: vendor/bin/rector --help
*/

/**
* Configure directories to be analyzed
*/
$rectorConfig->paths([
__DIR__ . '/bin',
__DIR__ . '/config',
__DIR__ . '/data',
__DIR__ . '/public',
__DIR__ . '/src',
__DIR__ . '/test',
]);

/**
* Exclude directories from being analyzed
*/
$rectorConfig->skip([
__DIR__ . '/data/cache',
]);

/**
* Select rules to be used by the analysis
*/
$rectorConfig->sets([
SetList::ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION,
SetList::PHP_81,
SetList::PHP_82,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::PSR_4,
SetList::TYPE_DECLARATION,
]);
};