Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests and PHP CS Fixer #65

Merged
merged 6 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ composer.lock
docs
vendor
coverage
.php_cs.cache
.php-cs-fixer.cache
15 changes: 9 additions & 6 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -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,
Expand All @@ -28,7 +31,7 @@
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method',
'method' => 'one',
],
],
'method_argument_space' => [
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Renderer/RendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down