Skip to content

Commit

Permalink
Merge pull request #361 from PHPCSStandards/php-8.1/document-support-…
Browse files Browse the repository at this point in the history
…for-named-params-after-arg-unpacking

PHP 8.1 | PassedParameters::getParameters(): document test with named params after argument unpacking
  • Loading branch information
jrfnl committed Oct 15, 2022
2 parents b1a4889 + 190a5e5 commit 81d22d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Tests/Utils/PassedParameters/GetParametersNamedTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ test(param: 1, param: 2);
// Error Exception, but not the concern of PHPCSUtils. Should still be handled.
array_fill(start_index: 0, ...[100, 50]);

/* testCompileErrorIncorrectOrderWithVariadic */
// Not the concern of PHPCSUtils. Should still be handled.
/* testPHP81NamedParamAfterVariadic */
// Prior to PHP 8.1, this was a compile error, but this is now supported.
test(...$values, param: $value);

/* testParseErrorNoValue */
Expand Down
5 changes: 3 additions & 2 deletions Tests/Utils/PassedParameters/GetParametersNamedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,9 @@ public function dataGetParameters()
],
],
],
'named-args-compile-error-incorrect-order-variadic' => [
'testMarker' => '/* testCompileErrorIncorrectOrderWithVariadic */',
// Prior to PHP 8.1, this was a compile error, but this is now supported.
'named-args-after-variadic' => [
'testMarker' => '/* testPHP81NamedParamAfterVariadic */',
'targetType' => \T_STRING,
'expected' => [
1 => [
Expand Down

0 comments on commit 81d22d0

Please sign in to comment.