From d6e0b77fe0317f0073dac399f966070005ef0689 Mon Sep 17 00:00:00 2001 From: GwanYeong Kim Date: Fri, 26 Oct 2018 20:29:45 +0900 Subject: [PATCH 1/2] Removed unused variables in FunctionCommentSniff.php --- .../Magento/Sniffs/Commenting/FunctionCommentSniff.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php index 2bd8be194..259a54408 100644 --- a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php +++ b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php @@ -68,7 +68,7 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) $phpcsFile->addError($error, $return, 'MissingReturnType'); } else { // Support both a return type and a description. - $split = preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); + preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); if (isset($returnParts[1]) === false) { return; } @@ -78,7 +78,7 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) // Check return type (can be multiple, separated by '|'). $typeNames = explode('|', $returnType); $suggestedNames = array(); - foreach ($typeNames as $i => $typeName) { + foreach ($typeNames as $typeName) { $suggestedName = Common::suggestType($typeName); if (in_array($suggestedName, $suggestedNames) === false) { $suggestedNames[] = $suggestedName; @@ -460,7 +460,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum => $line) { + foreach ($param['commentLines'] as $lineNum) { if ($lineNum === 0 || $param['commentLines'][$lineNum]['indent'] === 0 ) { From 58311dae1231e798ee5b614d06c5073cd3bb86f1 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 10 Dec 2018 11:21:44 -0600 Subject: [PATCH 2/2] Fix code review issue --- .../static/Magento/Sniffs/Commenting/FunctionCommentSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php index 259a54408..5050d5f03 100644 --- a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php +++ b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php @@ -460,7 +460,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum) { + foreach ($param['commentLines'] as $lineNum => $line) { if ($lineNum === 0 || $param['commentLines'][$lineNum]['indent'] === 0 ) {