Skip to content

Commit 0f915c5

Browse files
Allow applying the Param attribute at parameter level
1 parent a1e3eb9 commit 0f915c5

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"prefer-stable": true,
2525
"require": {
2626
"php": ">=8.0",
27-
"php-static-analysis/attributes": "^0.1 || dev-main",
28-
"php-static-analysis/node-visitor": "^0.1 || dev-main",
27+
"php-static-analysis/attributes": "^0.1.1 || dev-main",
28+
"php-static-analysis/node-visitor": "^0.1.1 || dev-main",
2929
"phpstan/phpstan": "^1.8"
3030
},
3131
"require-dev": {

tests/data/MethodParamAttribute.php

+23
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,27 @@ public function countNamesAndNames(array $names): int
6565
{
6666
return count($names);
6767
}
68+
69+
public function countNamesInParam(
70+
#[Param('string[]')]
71+
array $names
72+
): int {
73+
return count($names);
74+
}
75+
76+
public function countNamesInParamWithName(
77+
#[Param(names: 'string[]')]
78+
array $names
79+
): int {
80+
return count($names);
81+
}
82+
83+
public function countNamesInTwoParams(
84+
#[Param('string[]')]
85+
array $names1,
86+
#[Param('string[]')]
87+
array $names2
88+
): int {
89+
return count($names1) + count($names2);
90+
}
6891
}

0 commit comments

Comments
 (0)