Skip to content

Commit

Permalink
Update priority
Browse files Browse the repository at this point in the history
  • Loading branch information
tamiroh committed Feb 18, 2024
1 parent fff0ee4 commit 28edf77
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Fixer/Operator/NoUselessConcatOperatorFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getDefinition(): FixerDefinitionInterface
* {@inheritdoc}
*
* Must run before DateTimeCreateFromFormatCallFixer, EregToPregFixer, PhpUnitDedicateAssertInternalTypeFixer, RegularCallableCallFixer, SetTypeToCastFixer.
* Must run after NoBinaryStringFixer, SingleQuoteFixer.
* Must run after ExplicitStringVariableFixer, NoBinaryStringFixer, SingleQuoteFixer.
*/
public function getPriority(): int
{
Expand Down
3 changes: 2 additions & 1 deletion src/Fixer/StringNotation/ExplicitStringVariableFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ public function getDefinition(): FixerDefinitionInterface
/**
* {@inheritdoc}
*
* Must run before NoUselessConcatOperatorFixer.
* Must run after BacktickToShellExecFixer.
*/
public function getPriority(): int
{
return 0;
return 6;
}

public function isCandidate(Tokens $tokens): bool
Expand Down
3 changes: 3 additions & 0 deletions tests/AutoReview/FixerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ private static function getFixersPriorityGraph(): array
'heredoc_to_nowdoc',
'single_quote',
],
'explicit_string_variable' => [
'no_useless_concat_operator',
],
'final_class' => [
'protected_to_private',
'self_static_accessor',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
Integration of fixers: explicit_string_variable,no_useless_concat_operator.
--RULESET--
{"no_useless_concat_operator": true, "explicit_string_variable": true}
--EXPECT--
<?php

$foo = "bar {$baz}qux";

--INPUT--
<?php

$foo = "bar $baz" . "qux";

0 comments on commit 28edf77

Please sign in to comment.