-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update PHP versions and add ECS workflow.
- Loading branch information
1 parent
7d2fd17
commit 3d2d6e1
Showing
7 changed files
with
140 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ jobs: | |
os: >- | ||
['ubuntu-latest', 'windows-latest'] | ||
php: >- | ||
['8.1', '8.2'] | ||
['8.1', '8.2', '8.3'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ jobs: | |
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1', '8.2'] | ||
['8.1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
|
||
push: | ||
branches: ['main'] | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
|
||
name: ecs | ||
|
||
jobs: | ||
easy-coding-standard: | ||
uses: php-forge/actions/.github/workflows/ecs.yml@main | ||
secrets: | ||
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} | ||
with: | ||
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,4 @@ jobs: | |
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1', '8.2'] | ||
['8.1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer; | ||
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer; | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; | ||
|
||
return function (ECSConfig $ecsConfig): void { | ||
$ecsConfig->paths( | ||
[ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
] | ||
); | ||
|
||
// this way you add a single rule | ||
$ecsConfig->rules( | ||
[ | ||
OrderedClassElementsFixer::class, | ||
OrderedTraitsFixer::class, | ||
NoUnusedImportsFixer::class, | ||
] | ||
); | ||
|
||
// this way you can add sets - group of rules | ||
$ecsConfig->sets( | ||
[ | ||
// run and fix, one by one | ||
SetList::DOCBLOCK, | ||
SetList::NAMESPACES, | ||
SetList::COMMENTS, | ||
SetList::PSR_12, | ||
] | ||
); | ||
|
||
// this way configures a rule | ||
$ecsConfig->ruleWithConfiguration( | ||
ClassDefinitionFixer::class, | ||
[ | ||
'space_before_parenthesis' => true, | ||
], | ||
); | ||
}; |