diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 595c61e3..5f9534fa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,6 +33,31 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr + rector: + name: Run rector + runs-on: "ubuntu-22.04" + strategy: + matrix: + php: + - '8.3' + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP Action + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + extensions: 'pdo_sqlite, gd' + tools: cs2pr + + - uses: ramsey/composer-install@v3 + with: + dependency-versions: highest + + - name: Run rector + run: vendor/bin/rector process --dry-run --ansi + tests: name: Unit tests runs-on: "ubuntu-22.04" diff --git a/composer.json b/composer.json index 2e10e96e..ec4371f6 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "require-dev": { "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "~5.0.x-dev", + "ibexa/rector": "~5.0.x-dev", "matthiasnoback/symfony-dependency-injection-test": "^4.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 393de620..234c4934 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -325,11 +325,6 @@ parameters: count: 1 path: src/lib/Gateway/DistributionStrategy/StandaloneDistributionStrategy.php - - - message: "#^Method Ibexa\\\\Solr\\\\Gateway\\\\Endpoint\\:\\:__construct\\(\\) has parameter \\$properties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Gateway/Endpoint.php - - message: "#^Method Ibexa\\\\Solr\\\\Gateway\\\\EndpointRegistry\\:\\:registerEndpoint\\(\\) has no return type specified\\.$#" count: 1 diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..da984b15 --- /dev/null +++ b/rector.php @@ -0,0 +1,25 @@ +withPaths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->withSets([ + IbexaSetList::IBEXA_50->value, + SymfonySetList::SYMFONY_60, + SymfonySetList::SYMFONY_61, + SymfonySetList::SYMFONY_62, + SymfonySetList::SYMFONY_63, + SymfonySetList::SYMFONY_64, + ]);