Skip to content

Commit

Permalink
Merge pull request #6 from shopware5/chore/cleanup-code
Browse files Browse the repository at this point in the history
chore: Update cs-fixer and fix PHPStan issues
  • Loading branch information
mitelg authored Dec 9, 2024
2 parents 645db5e + c7e71a9 commit 8f3102f
Show file tree
Hide file tree
Showing 55 changed files with 840 additions and 1,721 deletions.
29 changes: 24 additions & 5 deletions tests/.php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
use PhpCsFixerCustomFixers\Fixer\NoUselessCommentFixer;
use PhpCsFixerCustomFixers\Fixer\NoUselessDirnameCallFixer;
use PhpCsFixerCustomFixers\Fixer\NoUselessParenthesisFixer;
use PhpCsFixerCustomFixers\Fixer\NoUselessStrlenFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocNoIncorrectVarAnnotationFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocParamTypeFixer;
use PhpCsFixerCustomFixers\Fixer\PhpUnitAssertArgumentsOrderFixer;
use PhpCsFixerCustomFixers\Fixer\PhpUnitDedicatedAssertFixer;
use PhpCsFixerCustomFixers\Fixer\SingleSpaceAfterStatementFixer;
use PhpCsFixerCustomFixers\Fixer\SingleSpaceBeforeStatementFixer;
use PhpCsFixerCustomFixers\Fixer\NoSuperfluousConcatenationFixer;
use PhpCsFixerCustomFixers\Fixers;

$finder = PhpCsFixer\Finder::create()
Expand All @@ -18,6 +22,7 @@
return (new Config())
->registerCustomFixers(new Fixers())
->setRiskyAllowed(true)
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@PSR12' => true,
'@Symfony' => true,
Expand All @@ -28,27 +33,41 @@
'doctrine_annotation_indentation' => true,
'doctrine_annotation_spaces' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => ['copyright', 'category'],
'annotations' => ['copyright', 'category'],
],
'global_namespace_import' => true,
'modernize_types_casting' => true,
'native_function_invocation' => ['exclude' => ['ini_get'], 'strict' => false],
'no_alias_functions' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_superfluous_phpdoc_tags' => true,
'nullable_type_declaration_for_default_null_value' => true,
'operator_linebreak' => ['only_booleans' => true],
'ordered_class_elements' => true,
'phpdoc_line_span' => true,
'phpdoc_order' => true,
'phpdoc_separation' => ['groups' => [['ORM\*', 'Assert\*', 'ShopwareAssert\*'], ['deprecated', 'link', 'see', 'since'], ['author', 'copyright', 'license'], ['category', 'package', 'subpackage'], ['property', 'property-read', 'property-write']]],
'phpdoc_summary' => false,
'phpdoc_var_annotation_correct_order' => true,
'php_unit_dedicate_assert' => true,
'php_unit_dedicate_assert_internal_type' => true,
'php_unit_construct' => true,
'php_unit_mock' => true,
'php_unit_mock_short_will_return' => true,
'php_unit_test_case_static_method_calls' => true,
'single_line_throw' => false,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
'operator_linebreak' => ['only_booleans' => true],
'native_function_invocation' => true,

NoUselessCommentFixer::name() => true,
SingleSpaceAfterStatementFixer::name() => true,
SingleSpaceBeforeStatementFixer::name() => true,
PhpdocParamTypeFixer::name() => true,
NoSuperfluousConcatenationFixer::name() => true,
NoUselessStrlenFixer::name() => true,
NoUselessParenthesisFixer::name() => true,
PhpUnitDedicatedAssertFixer::name() => true,
PhpUnitAssertArgumentsOrderFixer::name() => true,
PhpdocNoIncorrectVarAnnotationFixer::name() => true,
NoUselessDirnameCallFixer::name() => true,
])
->setFinder($finder);
Loading

0 comments on commit 8f3102f

Please sign in to comment.