Skip to content

Commit

Permalink
bug #4794 TernaryToElvisOperatorFixer - fix open tag with echo (Space…
Browse files Browse the repository at this point in the history
…Possum)

This PR was merged into the 2.17-dev branch.

Discussion
----------

TernaryToElvisOperatorFixer - fix open tag with echo

Commits
-------

afe5bd4 TernaryToElvisOperatorFixer - fix open tag with echo
  • Loading branch information
SpacePossum committed Feb 11, 2020
2 parents a21c7a9 + afe5bd4 commit 0047321
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Fixer/Operator/TernaryToElvisOperatorFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ final class TernaryToElvisOperatorFixer extends AbstractFixer
const VALID_BEFORE_ENDTYPES = [
'=',
[T_OPEN_TAG],
[T_OPEN_TAG_WITH_ECHO],
'(',
',',
';',
Expand Down
5 changes: 5 additions & 0 deletions tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ public function provideFixCases()
$c = [--$a] ? [--$a] : $b;
',
];

yield [
'<?= $a ? : $b ?>',
'<?= $a ? $a : $b ?>',
];
}

/**
Expand Down

0 comments on commit 0047321

Please sign in to comment.