8000 check for the presence of a scope closer (#173) · djoos/Symfony-coding-standard@245812d · GitHub
[go: up one dir, main page]

Skip to content

Commit 245812d

Browse files
wickedOnedjoos
authored andcommitted
check for the presence of a scope closer (#173)
fixes throwing an exception when inline control structures are used this should be taken care of by the Generic.ControlStructures.InlineControlStructure sniff so we can safely return fixes #170
1 parent b131160 commit 245812d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Symfony/Sniffs/Formatting/ReturnOrThrowSniff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ public function process(File $phpcsFile, $stackPtr)
9595

9696
$scopeCloserLine = -1;
9797

98+
if (false === isset($tokens[$opener]['scope_closer'])) {
99+
return;
100+
}
101+
98102
if ($opener) {
99103
$scopeCloserLine = $tokens[$tokens[$opener]['scope_closer']]['line'];
100104
}

0 commit comments

Comments
 (0)
0