Skip to content
Snippets Groups Projects
Commit 596eafff authored by Klaus Purer's avatar Klaus Purer
Browse files

fix(UnusedUseStatementSniff): Fix test case for false positives with return...

fix(UnusedUseStatementSniff): Fix test case for false positives with return types and use statements (#2830670)
parent b8953fd4
No related branches found
No related tags found
No related merge requests found
...@@ -134,7 +134,7 @@ class Drupal_Sniffs_Classes_UnusedUseStatementSniff implements PHP_CodeSniffer_S ...@@ -134,7 +134,7 @@ class Drupal_Sniffs_Classes_UnusedUseStatementSniff implements PHP_CodeSniffer_S
} }
}//end if }//end if
$classUsed = $phpcsFile->findNext(T_STRING, ($classUsed + 1)); $classUsed = $phpcsFile->findNext([T_STRING, T_RETURN_TYPE], ($classUsed + 1));
}//end while }//end while
$warning = 'Unused use statement'; $warning = 'Unused use statement';
......
...@@ -1518,5 +1518,5 @@ function test22(MyInterface $a) { ...@@ -1518,5 +1518,5 @@ function test22(MyInterface $a) {
* What we return. * What we return.
*/ */
function test23(): TestReturnType { function test23(): TestReturnType {
return new TestReturnType(); return foo();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment