supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; // Skip function without body. if (isset($token['scope_opener']) === false) { return; } // Get all parameters from method signature. $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); if (empty($parameters) || \is_array($parameters) === false) { return; } $paramNames = array(); foreach ($parameters as $param) { $paramNames[] = $param['name']; } if (\count($paramNames) !== \count(array_unique($paramNames))) { $phpcsFile->addError( 'Functions can not have multiple parameters with the same name since PHP 7.0', $stackPtr, 'Found' ); } } }