Skip to content

Commit

Permalink
build(ci): Add Rector into static analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Czarnecki committed Jan 2, 2024
1 parent 4ff99e4 commit e8e2dd8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ jobs:

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"

- name: "Run a static analysis with rector/rector"
run: "vendor/bin/rector --dry-run"
if: ${{ matrix.php-version == 8.2 }}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"phpstan/phpstan": "^1.0.2",
"phpunit/phpunit": "^9.0 || ^10.0",
"psr/container": "^1.0 || ^2.0",
"rector/rector": "^0.18.13",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/expression-language": "^5.4 || ^6.0 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
Expand Down
13 changes: 13 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig) {
$rectorConfig->paths([
__DIR__ . '/src',
]);
$rectorConfig->sets([LevelSetList::UP_TO_PHP_74]);
};

0 comments on commit e8e2dd8

Please sign in to comment.