Skip to content

Commit

Permalink
Merge pull request #67 from spatie/symfony-v6
Browse files Browse the repository at this point in the history
Symfony v6
  • Loading branch information
Nielsvanpach authored Dec 21, 2021
2 parents d2adb1c + 459498f commit 94499d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
32 changes: 13 additions & 19 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,21 @@ name: Check & fix styling
on: [push]

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

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs --allow-risky=yes
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist.php --allow-risky=yes

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: Fix styling
branch: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
composer.phar
composer.lock
.php_cs.cache
.php-cs-fixer.cache
16 changes: 7 additions & 9 deletions .php_cs → .php_cs.dist.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('vendor')
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -13,14 +10,14 @@
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\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 @@ -31,12 +28,13 @@
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method', 'property',
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
]
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"php" : "^8.0",
"illuminate/support": "^8.0",
"illuminate/console": "^8.0",
"symfony/process": "^5.0",
"symfony/process": "^5.0|^6.0",
"spatie/ssh": "^1.4",
"spatie/laravel-package-tools": "^1.9"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.4",
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.4"

},
Expand Down

0 comments on commit 94499d7

Please sign in to comment.