diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2d44a2..40c2e99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - php-version: ['7.2', '7.3', '7.4', '8.0'] + php-version: ['7.2', '7.3', '7.4', '8.0', '8.1'] name: 'PHPUnit - PHP/${{ matrix.php-version }} - OS/${{ matrix.os }}' steps: - name: Checkout @@ -39,7 +39,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - php-version: [ '7.4' ] + php-version: [ '8.1' ] name: 'Coding style' steps: - name: Checkout @@ -61,14 +61,14 @@ jobs: - name: Install Dependencies run: composer install --no-progress - name: PHPUnit - run: vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run . + run: vendor/bin/php-cs-fixer fix -v --dry-run . phpstan: runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest ] - php-version: [ '7.4', '8.0' ] + php-version: [ '8.0', '8.1' ] name: 'PHPStan - PHP/${{ matrix.php-version }} - OS/${{ matrix.os }}' steps: - name: Checkout diff --git a/.gitignore b/.gitignore index 6988076..aafeabb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -.php_cs.cache +.php-cs-fixer.cache .phpunit.result.cache composer.lock vendor/ diff --git a/.php_cs b/.php-cs-fixer.php similarity index 72% rename from .php_cs rename to .php-cs-fixer.php index 46122fb..e223b5b 100644 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -9,15 +9,16 @@ file that was distributed with this source code. EOF; -return PhpCsFixer\Config::create() +$finder = PhpCsFixer\Finder::create() + ->ignoreDotFiles(false) + ->ignoreVCSIgnored(true) + ->in(__DIR__) +; + +return (new PhpCsFixer\Config()) ->setRules([ '@PSR2' => true, 'function_declaration' => ['closure_function_spacing' => 'none'], 'no_whitespace_in_blank_line' => true, ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->in(__DIR__) - ) ; diff --git a/composer.json b/composer.json index bac723d..00e125b 100644 --- a/composer.json +++ b/composer.json @@ -22,9 +22,9 @@ "ext-gd": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^v2.17.1", + "friendsofphp/php-cs-fixer": "^3.4", "phpunit/phpunit": "^8.5.13", - "phpstan/phpstan": "^0.12.59" + "phpstan/phpstan": "^1.3" }, "suggest": { "ext-exif": "Allows to read and keep images EXIF data"