Skip to content

Commit 0e08dba

Browse files
committed
Fix PHP Notice
1 parent 040f675 commit 0e08dba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function process(File $phpcsFile, $stackPtr)
109109
$next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
110110
if ($tokens[$next]['code'] === T_SEMICOLON) {
111111
$next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true);
112-
if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) {
112+
if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET && isset($tokens[$next]['scope_condition']) === true) {
113113
// If this is the closing brace of a function
114114
// then this return statement doesn't return anything
115115
// and is not required anyway.

0 commit comments

Comments
 (0)