Skip to content

Commit

Permalink
removing array_key_exists from for loop to avoid ignoring phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBrownAustin committed Dec 22, 2023
1 parent 59b5d46 commit 17e120f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Magento2/Sniffs/Annotation/MethodArgumentsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,15 +668,7 @@ private function checkIfNamespaceContainsApi(File $phpcsFile) : bool
return false;
}
$tokens = $phpcsFile->getTokens();
// phpcs:ignore Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen,Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for (
// phpcs:ignore Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterFirst
$index = $namespaceStackPtr;
// phpcs:ignore Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterSecond
array_key_exists($index, $tokens) && 'T_SEMICOLON' !== $tokens[$index]['type'];
$index++
// phpcs:ignore Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose
) {
for ($index = $namespaceStackPtr; 'T_SEMICOLON' !== ($tokens[$index]['type'] ?? 'T_SEMICOLON'); $index++) {
if ('T_STRING' === $tokens[$index]['type'] && 'Api' === $tokens[$index]['content']) {
return true;
}
Expand Down

0 comments on commit 17e120f

Please sign in to comment.