| @@ 325-348 (lines=24) @@ | ||
| 322 | } |
|
| 323 | ||
| 324 | // Make sure the param name is correct. |
|
| 325 | if (isset($realParams[$pos]) === true) { |
|
| 326 | $realName = $realParams[$pos]['name']; |
|
| 327 | if ($realName !== $param['var']) { |
|
| 328 | $code = 'ParamNameNoMatch'; |
|
| 329 | $data = array( |
|
| 330 | $param['var'], |
|
| 331 | $realName, |
|
| 332 | ); |
|
| 333 | ||
| 334 | $error = 'Doc comment for parameter %s does not match '; |
|
| 335 | if (strtolower($param['var']) === strtolower($realName)) { |
|
| 336 | $error .= 'case of '; |
|
| 337 | $code = 'ParamNameNoCaseMatch'; |
|
| 338 | } |
|
| 339 | ||
| 340 | $error .= 'actual variable name %s'; |
|
| 341 | ||
| 342 | $phpcsFile->addError($error, $param['tag'], $code, $data); |
|
| 343 | } |
|
| 344 | } else if (substr($param['var'], -4) !== ',...') { |
|
| 345 | // We must have an extra parameter comment. |
|
| 346 | $error = 'Superfluous parameter comment'; |
|
| 347 | $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); |
|
| 348 | }//end if |
|
| 349 | ||
| 350 | if ($param['comment'] === '') { |
|
| 351 | continue; |
|
| @@ 499-522 (lines=24) @@ | ||
| 496 | }//end if |
|
| 497 | ||
| 498 | // Make sure the param name is correct. |
|
| 499 | if (isset($realParams[$pos]) === true) { |
|
| 500 | $realName = $realParams[$pos]['name']; |
|
| 501 | if ($realName !== $param['var']) { |
|
| 502 | $code = 'ParamNameNoMatch'; |
|
| 503 | $data = array( |
|
| 504 | $param['var'], |
|
| 505 | $realName, |
|
| 506 | ); |
|
| 507 | ||
| 508 | $error = 'Doc comment for parameter %s does not match '; |
|
| 509 | if (strtolower($param['var']) === strtolower($realName)) { |
|
| 510 | $error .= 'case of '; |
|
| 511 | $code = 'ParamNameNoCaseMatch'; |
|
| 512 | } |
|
| 513 | ||
| 514 | $error .= 'actual variable name %s'; |
|
| 515 | ||
| 516 | $phpcsFile->addError($error, $param['tag'], $code, $data); |
|
| 517 | } |
|
| 518 | } else if (substr($param['var'], -4) !== ',...') { |
|
| 519 | // We must have an extra parameter comment. |
|
| 520 | $error = 'Superfluous parameter comment'; |
|
| 521 | $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); |
|
| 522 | }//end if |
|
| 523 | ||
| 524 | if ($param['comment'] === '') { |
|
| 525 | continue; |
|