Skip to content

Commit

Permalink
Remove reference to PSR-19
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Jun 8, 2023
1 parent daf6e09 commit 5f8c04d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,9 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
$foundParams[(count($foundParams) - 1)] = substr($param['var'], 1);

if ($realParams[$pos]['pass_by_reference'] === true) {
// When passed by reference, the variable name in $realParams does not
// have a leading '&'. There is no guidance in PSR-19 to say if the
// docblock SHOULD or SHOULD NOT also have a leading '&'. Therefore,
// this sniff remains agnostic in this case.
// Even when passed by reference, the variable name in
// $realParams does not have a leading '&'. This sniff
// will accept both '&$var' and '$var' in these cases.
$paramVarName = substr($param['var'], 1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,7 @@ function throwCommentOneLine() {}
/**
* Test for passing variables by reference
*
* Note that PSR-19 makes no mention of variables passed by reference. This
* sniff treats the '&' as optional for parameters passed by reference, but
* This sniff treats the '&' as optional for parameters passed by reference, but
* forbidden for parameters which are not passed by reference.
*
* Because mismatches may be in either direction, we cannot auto-fix these.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,7 @@ function throwCommentOneLine() {}
/**
* Test for passing variables by reference
*
* Note that PSR-19 makes no mention of variables passed by reference. This
* sniff treats the '&' as optional for parameters passed by reference, but
* This sniff treats the '&' as optional for parameters passed by reference, but
* forbidden for parameters which are not passed by reference.
*
* Because mismatches may be in either direction, we cannot auto-fix these.
Expand Down
14 changes: 7 additions & 7 deletions src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ public function getErrorList()
1006 => 1,
1029 => 1,
1050 => 1,
1061 => 1,
1062 => 1,
1063 => 1,
1072 => 4,
1071 => 4,
1078 => 1,
1079 => 1,
1080 => 1,
1081 => 1,
1082 => 1,
1101 => 1,
1102 => 1,
1103 => 1,
1104 => 1,
];

// Scalar type hints only work from PHP 7 onwards.
Expand All @@ -141,9 +141,9 @@ public function getErrorList()
$errors[575] = 2;
$errors[627] = 1;
$errors[1002] = 1;
$errors[1067] = 5;
$errors[1086] = 8;
$errors[1108] = 3;
$errors[1066] = 5;
$errors[1085] = 8;
$errors[1107] = 3;
} else {
$errors[729] = 4;
$errors[740] = 2;
Expand Down

0 comments on commit 5f8c04d

Please sign in to comment.