Skip to content

Commit

Permalink
Upgraded friendsofphp/php-cs-fixer to ^3.0 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored Oct 3, 2021
1 parent e96f01d commit e8ca20f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/coding_style_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Coding Style Checks

on: [ push, pull_request, workflow_dispatch ]

jobs:
ci:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.os }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4', '8.0']
max-parallel: 4
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpize
coverage: none

- name: Setup Deps
run:
composer install -o

- name: Coding Style Checks
run:
composer cs-check
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor/
composer.lock
.idea
config.php
properties.php
6 changes: 3 additions & 3 deletions .php_cs.dist → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
please view the LICENSE file that was distributed with this source code
TEXT;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'header_comment' => [
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
'header' => $header,
'separate' => 'bottom',
'location' => 'after_open',
Expand Down Expand Up @@ -85,7 +85,7 @@
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'linebreak_after_opening_tag' => true,
'lowercase_constants' => true,
'constant_case' => true,
'lowercase_static_reference' => true,
'no_useless_else' => true,
'no_unused_imports' => true,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require": {
"symfony/console": "^5.2",
"simps/mqtt": "^1.3",
"friendsofphp/php-cs-fixer": "^2.18",
"friendsofphp/php-cs-fixer": "^3.0",
"ext-json": "*"
},
"autoload": {
Expand Down

0 comments on commit e8ca20f

Please sign in to comment.