Skip to content

Commit

Permalink
Fix PHP Notice
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Dec 13, 2023
1 parent 040f675 commit 0e08dba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function process(File $phpcsFile, $stackPtr)
$next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
if ($tokens[$next]['code'] === T_SEMICOLON) {
$next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true);
if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) {
if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET && isset($tokens[$next]['scope_condition']) === true) {
// If this is the closing brace of a function
// then this return statement doesn't return anything
// and is not required anyway.
Expand Down

0 comments on commit 0e08dba

Please sign in to comment.