diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7c5b7e8..414cddb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: - php-version: 8.2 phing_tasks: "phpunitfast" - php-version: 8.3 - phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console" + phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console rector-console" steps: - name: Setup PHP @@ -27,6 +27,13 @@ jobs: php-version: ${{ matrix.php-version }} extensions: intl, xsl + - name: Cache rector data + uses: actions/cache@v4 + with: + path: .rector + key: "php-${{ matrix.php-version }}-rector-${{ github.sha }}" + restore-keys: "php-${{ matrix.php-version }}-rector-" + - name: Checkout uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 6de40ea..66e7fa4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.lock .php_cs_cache .phpstan_cache tests/.phpunit.result.cache +.rector diff --git a/build.xml b/build.xml index 74e498d..3fd265e 100644 --- a/build.xml +++ b/build.xml @@ -38,6 +38,7 @@ + @@ -82,6 +83,18 @@ + + + + + + + + + + + + diff --git a/composer.json b/composer.json index 2313166..740644a 100644 --- a/composer.json +++ b/composer.json @@ -26,13 +26,13 @@ "php": ">=8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.64.0", + "friendsofphp/php-cs-fixer": "3.89.2", "guzzlehttp/guzzle": "^7.8.1", - "pear/http_request2": "2.6.0", "phpmd/phpmd": "2.15.0", - "phpstan/phpstan": "1.12.7", + "phpstan/phpstan": "2.1.32", "phpunit/phpunit": "10.5.36", - "phing/phing": "3.0", - "squizlabs/php_codesniffer": "3.10.3" + "phing/phing": "3.1.0", + "rector/rector": "2.2.7", + "squizlabs/php_codesniffer": "4.0.1" } } diff --git a/tests/phpcs.xml b/tests/phpcs.xml index 55f14a4..12dbbf9 100644 --- a/tests/phpcs.xml +++ b/tests/phpcs.xml @@ -5,6 +5,7 @@ . */config/* *.php-cs-fixer.* + *rector.* diff --git a/tests/rector.php b/tests/rector.php new file mode 100644 index 0000000..e51d604 --- /dev/null +++ b/tests/rector.php @@ -0,0 +1,21 @@ +withCache( + cacheClass: FileCacheStorage::class, + cacheDirectory: __DIR__ . '/../.rector' + )->withPaths([ + __DIR__ . '/../src', + ]) + ->withSets([ + PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, + ]) + ->withTypeCoverageLevel(0) + ->withDeadCodeLevel(6) + ->withCodeQualityLevel(18);