Skip to content

Commit

Permalink
Add support for Laravel 9
Browse files Browse the repository at this point in the history
  • Loading branch information
mbardelmeijer committed Feb 9, 2022
1 parent 1b4eea3 commit ccb2dd2
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 56 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ name: Check & fix styling
on: [push]

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
steps:
- name: Checkout code
uses: actions/checkout@v2
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
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
8 changes: 5 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4, 8.0]
laravel: [8.*]
php: [8.1]
laravel: [9.*, 8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
testbench: ^6.23

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
vendor
41 changes: 41 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

$finder = \PhpCsFixer\Finder::create()
->in([
__DIR__ . '/app',
__DIR__ . '/routes',
__DIR__ . '/database',
__DIR__ . '/tests',
])
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$rules = [
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
];

return (new \PhpCsFixer\Config())
->setRules($rules);
32 changes: 0 additions & 32 deletions .php_cs.dist

This file was deleted.

10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
}
],
"require": {
"php": "^7.4|^8.0",
"illuminate/support": "^8.0"
"php": "^8.1",
"illuminate/support": "^8.75|^9.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3"
"friendsofphp/php-cs-fixer": "^3.0",
"orchestra/testbench": "^6.23|^7.0",
"phpunit/phpunit": "^9.5"
},
"config": {
"sort-packages": true
Expand Down

0 comments on commit ccb2dd2

Please sign in to comment.