Skip to content

Commit

Permalink
fix "Undefined index: type_space [and var_space]"
Browse files Browse the repository at this point in the history
  • Loading branch information
luke83 committed Oct 9, 2015
1 parent 45c9448 commit 27a43b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CakePHP/Sniffs/Commenting/FunctionCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ protected function processParams(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co
$phpcsFile->addError($error, $tag, 'MissingParamType');
}//end if

$params[] = compact('tag', 'type', 'var', 'comment', 'commentLines', 'type_space', 'var_space');
$params[] = compact('tag', 'type', 'var', 'comment', 'commentLines', 'typeSpace', 'varSpace');
}//end foreach

$realParams = $phpcsFile->getMethodParameters($stackPtr);
Expand Down Expand Up @@ -392,9 +392,9 @@ protected function processParams(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co
$fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data);
if ($fix === true) {
$content = $suggestedName;
$content .= str_repeat(' ', $param['type_space']);
$content .= str_repeat(' ', $param['typeSpace']);
$content .= $param['var'];
$content .= str_repeat(' ', $param['var_space']);
$content .= str_repeat(' ', $param['varSpace']);
$content .= $param['commentLines'][0]['comment'];
$phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
}
Expand Down

0 comments on commit 27a43b1

Please sign in to comment.