Fix CS Fixer deprecations

This commit is contained in:
jmleroux 2021-11-11 00:51:24 +01:00
parent 1b4827db01
commit 7bd10a6829
3 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
$config = PhpCsFixer\Config::create() $config = (new PhpCsFixer\Config())
->setRiskyAllowed(true) ->setRiskyAllowed(true)
->setRules([ ->setRules([
'@Symfony' => true, '@Symfony' => true,
@ -13,13 +13,14 @@ $config = PhpCsFixer\Config::create()
'declare_equal_normalize' => ['space' => 'single'], 'declare_equal_normalize' => ['space' => 'single'],
'heredoc_to_nowdoc' => true, 'heredoc_to_nowdoc' => true,
'increment_style' => ['style' => 'post'], 'increment_style' => ['style' => 'post'],
'is_null' => ['use_yoda_style' => false], 'method_argument_space' => [
'method_argument_space' => ['ensure_fully_multiline' => true], 'on_multiline' => 'ensure_fully_multiline'
],
'modernize_types_casting' => true, 'modernize_types_casting' => true,
'no_break_comment' => ['comment_text' => 'do nothing'], 'no_break_comment' => ['comment_text' => 'do nothing'],
'no_empty_phpdoc' => false, 'no_empty_phpdoc' => false,
'no_null_property_initialization' => true, 'no_null_property_initialization' => true,
'no_short_echo_tag' => true, 'echo_tag_syntax' => false,
'no_superfluous_elseif' => true, 'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false, 'no_superfluous_phpdoc_tags' => false,
'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'switch_case', 'yield']], 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'switch_case', 'yield']],
@ -37,7 +38,7 @@ $config = PhpCsFixer\Config::create()
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'phpdoc_separation' => false, 'phpdoc_separation' => false,
'protected_to_private' => true, 'protected_to_private' => true,
'psr4' => true, 'psr_autoloading' => true,
'return_type_declaration' => ['space_before' => 'one'], 'return_type_declaration' => ['space_before' => 'one'],
'semicolon_after_instruction' => true, 'semicolon_after_instruction' => true,
'simplified_null_return' => false, 'simplified_null_return' => false,

View File

@ -42,7 +42,7 @@ before_script:
script: script:
- | - |
if [[ "$WITH_CS" == "true" ]]; then if [[ "$WITH_CS" == "true" ]]; then
vendor/bin/php-cs-fixer fix --config=.php_cs.dist --verbose --diff --dry-run --diff-format=udiff vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --diff-format=udiff
fi fi
- | - |
if [[ "$WITH_PHPUNIT" == "true" ]]; then if [[ "$WITH_PHPUNIT" == "true" ]]; then

View File

@ -48,12 +48,18 @@ First install the dependencies with docker-compose
docker-compose run --rm -u ${UID} php composer install docker-compose run --rm -u ${UID} php composer install
``` ```
Then launch the tests Then launch the PHPUnit tests
```bash ```bash
docker-compose run --rm php vendor/bin/phpunit docker-compose run --rm php vendor/bin/phpunit
``` ```
Same for CS Fixer tests
```bash
docker-compose run --rm php vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --diff-format=udiff
```
## Support ## Support
You can ask questions, submit new features ideas or discuss Spout in the chat room:<br> You can ask questions, submit new features ideas or discuss Spout in the chat room:<br>