Skip to content

Commit

Permalink
[CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketR…
Browse files Browse the repository at this point in the history
…ector (#5122)

* [CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector

* Fix
  • Loading branch information
samsonasik committed Oct 5, 2023
1 parent 3e0132d commit 1966194
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
@@ -0,0 +1,13 @@
<?php

namespace Rector\Tests\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector\Fixture;

class SkipVbStyle
{
public function run($value)
{
if ($value):
return 1;
endif;
}
}
Expand Up @@ -94,7 +94,7 @@ private function isIfConditionFollowedByOpeningCurlyBracket(If_ $if, array $oldT
$nextToken = $oldTokens[$i + 2];
}

if ($nextToken === '{') {
if (in_array($nextToken, ['{', ':'], true)) {
// all good
return true;
}
Expand Down

0 comments on commit 1966194

Please sign in to comment.