diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index c58c9ac..30a62b7 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -8,14 +8,14 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - name: Run PHP CS Fixer uses: docker://oskarstark/php-cs-fixer-ga with: - args: --config=.php_cs.dist --allow-risky=yes + args: --config=.php-cs-fixer.dist.php --allow-risky=yes - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 55dc711..9877ff4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,14 +9,14 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2, 8.1, 8.0, 7.4, 7.3] + php: [8.4, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3] stability: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.gitignore b/.gitignore index 21c587a..6dc30fa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ composer.lock docs vendor coverage -.php_cs.cache +.php-cs-fixer.cache diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 79% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index ac127a7..7585169 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -1,6 +1,9 @@ in([ __DIR__ . '/src', __DIR__ . '/tests', @@ -10,14 +13,14 @@ ->ignoreDotFiles(true) ->ignoreVCS(true); -return PhpCsFixer\Config::create() +return (new Config()) ->setRules([ - '@PSR2' => true, + '@PSR12' => true, 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => true, 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, @@ -28,7 +31,7 @@ 'phpdoc_var_without_name' => true, 'class_attributes_separation' => [ 'elements' => [ - 'method', + 'method' => 'one', ], ], 'method_argument_space' => [ diff --git a/README.md b/README.md index c8b0c21..aef8607 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Server side rendering JavaScript in your PHP application [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/server-side-rendering.svg?style=flat-square)](https://packagist.org/packages/spatie/server-side-rendering) -[![Build Status](https://img.shields.io/travis/spatie/server-side-rendering/master.svg?style=flat-square)](https://travis-ci.org/spatie/server-side-rendering) +[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/spatie/server-side-rendering/run-tests.yml?branch=main&label=Tests)](https://github.com/spatie/server-side-rendering/actions?query=workflow%3ATests+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/server-side-rendering.svg?style=flat-square)](https://packagist.org/packages/spatie/server-side-rendering) ```php diff --git a/tests/Renderer/RendererTest.php b/tests/Renderer/RendererTest.php index f104506..d5417fd 100644 --- a/tests/Renderer/RendererTest.php +++ b/tests/Renderer/RendererTest.php @@ -2,7 +2,7 @@ namespace Spatie\Ssr\Tests\Renderer; -use Spatie\Ssr\Exceptions\ServerScriptDoesNotExist; +use Spatie\Ssr\Exceptions\ServerScriptNotReadable; use Symfony\Component\Process\Exception\ProcessFailedException; class RendererTest extends TestCase @@ -77,7 +77,7 @@ public function it_throws_an_engine_error_when_server_rendering_fails_and_debug_ /** @test */ public function it_always_throws_an_exception_when_the_server_script_does_not_exist() { - $this->expectException(ServerScriptDoesNotExist::class); + $this->expectException(ServerScriptNotReadable::class); $this->renderer ->entry(__DIR__.'/../scripts/app-doesnt-exist.js')