-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CI and PHP CS Fixer * fix deprecated rule, blank line between import groups, indentation * disable ordered_class_elements rule
- Loading branch information
Showing
22 changed files
with
295 additions
and
169 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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: ~ | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: "Build and Test - PHP ${{ matrix.php }} Symfony:${{ matrix.symfony-version }} ${{ matrix.deps }}" | ||
runs-on: ubuntu-latest | ||
env: | ||
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0 | ||
strategy: | ||
matrix: | ||
include: | ||
- symfony-version: 6.4 | ||
php: 8.2 | ||
deps: low | ||
- symfony-version: 7.0 | ||
php: 8.2 | ||
deps: high | ||
- symfony-version: 7.0 | ||
php: 8.3 | ||
deps: high | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
if: matrix.deps == 'high' | ||
run: composer install | ||
|
||
- name: Install dependencies (min) | ||
if: matrix.deps == 'low' | ||
run: composer update --prefer-lowest --prefer-stable | ||
|
||
- name: Run test suite | ||
run: php vendor/bin/phpunit | ||
|
||
php-cs-fixer: | ||
name: PHP CS Fixer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHP CS Fixer | ||
run: php vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/vendor/ | ||
composer.lock | ||
.phpunit.result.cache | ||
/var/ | ||
/.phpunit.cache/ | ||
/tests/fixtures/cache/ | ||
/tests/fixtures/var/ | ||
/.phpunit.cache/ | ||
/var/ | ||
/vendor/ | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache | ||
composer.lock |
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,32 @@ | ||
<?php | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'array_indentation' => true, | ||
'blank_line_between_import_groups' => false, | ||
'compact_nullable_type_declaration' => true, | ||
'fully_qualified_strict_types' => true, | ||
'native_function_invocation' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'nullable_type_declaration_for_default_null_value' => false, | ||
'return_assignment' => true, | ||
'strict_param' => true, | ||
'trailing_comma_in_multiline' => [ | ||
'elements' => ['arguments', 'arrays', 'match', 'parameters'], | ||
], | ||
'void_return' => true, | ||
'yoda_style' => [ | ||
'always_move_variable' => true, | ||
], | ||
]) | ||
->setFinder($finder) | ||
; |
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
Oops, something went wrong.