diff --git a/resources/PHP/common.mk b/resources/PHP/common.mk index ad6e736..926f863 100644 --- a/resources/PHP/common.mk +++ b/resources/PHP/common.mk @@ -12,7 +12,7 @@ TTY:=$(shell [ -t 0 ] && echo --tty) endif ifndef PHPQA_DOCKER_IMAGE -PHPQA_DOCKER_IMAGE=jakzal/phpqa:1.76.0-php${PHP_VERSION}-alpine +PHPQA_DOCKER_IMAGE=jakzal/phpqa:1.77.6-php${PHP_VERSION}-alpine endif ifndef PHPQA_DOCKER_COMMAND diff --git a/resources/PHP/php-cs-fixer.php b/resources/PHP/php-cs-fixer.php new file mode 100644 index 0000000..38dca4f --- /dev/null +++ b/resources/PHP/php-cs-fixer.php @@ -0,0 +1,85 @@ +exclude('var') + ->exclude('vendor') + ->in($root); + + return (new Config()) + ->setCacheFile($root.'/var/phpqa/php-cs-fixer.cache') + ->setRiskyAllowed(true) + ->setRules( + [ + '@DoctrineAnnotation' => true, + '@PHP70Migration' => true, + '@PHP70Migration:risky' => true, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, + '@PHP73Migration' => true, + '@PHP74Migration' => true, + '@PHP74Migration:risky' => true, + '@PHP80Migration' => true, + '@PHP80Migration:risky' => true, + '@PhpCsFixer' => true, + '@PhpCsFixer:risky' => true, + '@Symfony' => true, + '@Symfony:risky' => true, + 'header_comment' => ['header' => $header], + 'date_time_immutable' => true, + 'final_class' => true, + 'general_phpdoc_annotation_remove' => ['annotations' => ['@author']], + 'mb_str_functions' => true, + 'method_chaining_indentation' => false, + 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], + 'not_operator_with_successor_space' => true, + 'ordered_interfaces' => true, + 'php_unit_internal_class' => true, + 'php_unit_size_class' => true, + 'phpdoc_order_by_value' => ['annotations' => [ + 'covers', + 'coversNothing', + 'dataProvider', + 'depends', + 'group', + 'internal', + 'method', + 'mixin', + 'property', + 'property-read', + 'property-write', + 'requires', + 'throws', + 'uses', + ]], + 'phpdoc_to_comment' => ['ignored_tags' => ['phpstan-ignore-next-line', 'psalm-suppress']], + 'phpdoc_to_return_type' => true, + 'phpdoc_types_order' => [ + 'null_adjustment' => 'always_first', + ], + 'return_assignment' => false, + 'static_lambda' => true, + 'use_arrow_functions' => false, + 'yoda_style' => [ + 'always_move_variable' => true, + 'equal' => false, + 'identical' => false, + 'less_and_greater' => false, + ], + ] + ) + ->setFinder($finder); +};