supportsBelow('7.0') === false) { return; } if ($this->isShortList($phpcsFile, $stackPtr) === false) { return; } $tokens = $phpcsFile->getTokens(); $closer = $tokens[$stackPtr]['bracket_closer']; $hasVariable = $phpcsFile->findNext(\T_VARIABLE, ($stackPtr + 1), $closer); if ($hasVariable === false) { // List syntax is only valid if there are variables in it. return; } $phpcsFile->addError( 'The shorthand list syntax "[]" to destructure arrays is not available in PHP 7.0 or earlier.', $stackPtr, 'Found' ); return ($closer + 1); } }