-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Handle missing bracket on If only on CompleteMissingIfE…
…lseBracketRector (#5134) * [CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector * [ci-review] Rector Rectify * [ci-review] Rector Rectify * Fixed 🎉 * fix use current laststmt --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
96d0612
commit dbd374b
Showing
3 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
.../Rector/If_/CompleteMissingIfElseBracketRector/Fixture/missing_bracket_on_if_only.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector\Fixture; | ||
|
||
class MissingBracketOnIfOnly | ||
{ | ||
public function run($value) | ||
{ | ||
if ($value) | ||
return 1; | ||
else { | ||
return 2; | ||
} | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector\Fixture; | ||
|
||
class MissingBracketOnIfOnly | ||
{ | ||
public function run($value) | ||
{ | ||
if ($value) { | ||
return 1; | ||
} else { | ||
return 2; | ||
} | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters