Skip to content

Commit

Permalink
fix: conflict bettween method_argument_space and line_break_between_m…
Browse files Browse the repository at this point in the history
…ethod_arguments
  • Loading branch information
PedroTroller committed Sep 25, 2023
1 parent 671af72 commit f8bdffd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use PedroTroller\CS\Fixer\Priority;
use PhpCsFixer\Fixer\Basic\BracesFixer;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
Expand All @@ -22,7 +23,10 @@ final class LineBreakBetweenMethodArgumentsFixer extends AbstractFixer implement

public function getPriority(): int
{
return Priority::after(BracesFixer::class);
return min(
Priority::after(BracesFixer::class),
Priority::after(MethodArgumentSpaceFixer::class),
);
}

public function getSampleConfigurations(): array
Expand Down
8 changes: 8 additions & 0 deletions tests/Orchestra.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
namespace tests;

use PedroTroller\CS\Fixer\ClassNotation\OrderedWithGetterAndSetterFirstFixer;
use PedroTroller\CS\Fixer\CodingStyle\LineBreakBetweenMethodArgumentsFixer;
use PedroTroller\CS\Fixer\DoctrineMigrationsFixer;
use PhpCsFixer\Fixer\Basic\BracesFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer;
use PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer;
use PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer;
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
Expand Down Expand Up @@ -41,6 +44,11 @@ public static function run(): void
->before(new NoWhitespaceInBlankLineFixer())
;

self::assert(new LineBreakBetweenMethodArgumentsFixer())
->after(new BracesFixer())
->after(new MethodArgumentSpaceFixer())
;

echo "\n";
}

Expand Down

0 comments on commit f8bdffd

Please sign in to comment.