diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml new file mode 100644 index 0000000..bd79331 --- /dev/null +++ b/.github/workflows/rector.yml @@ -0,0 +1,23 @@ +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + - 'infection.json.dist' + - 'psalm.xml' + +name: rector + +jobs: + rector: + uses: yiisoft/actions/.github/workflows/rector.yml@master + secrets: + token: ${{ secrets.YIISOFT_GITHUB_TOKEN }} + with: + os: >- + ['ubuntu-latest'] + php: >- + ['8.2'] diff --git a/composer.json b/composer.json index 495b49d..1cef03d 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "require-dev": { "nyholm/psr7": "^1.3", "phpunit/phpunit": "^9.5", + "rector/rector": "^0.18.5", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", "vimeo/psalm": "^4.30|^5.6", diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..95bde68 --- /dev/null +++ b/rector.php @@ -0,0 +1,29 @@ +paths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + + // register a single rule + $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + + // define sets of rules + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_74, + ]); + + $rectorConfig->skip([ + ClosureToArrowFunctionRector::class, + JsonThrowOnErrorRector::class, + ]); +}; diff --git a/src/Synchronizer/Storage/CsrfTokenStorageInterface.php b/src/Synchronizer/Storage/CsrfTokenStorageInterface.php index 40e4064..8b1dd26 100644 --- a/src/Synchronizer/Storage/CsrfTokenStorageInterface.php +++ b/src/Synchronizer/Storage/CsrfTokenStorageInterface.php @@ -16,8 +16,6 @@ public function get(): ?string; /** * Write CSRF token into a storage. - * - * @param string $token */ public function set(string $token): void;