@@ -49,12 +49,6 @@ final class Method extends BaseTag implements Factory\StaticMethod
49
49
/** @var string */
50
50
private $ methodName ;
51
51
52
- /**
53
- * @phpstan-var array<int, array{name: string, type: Type}>
54
- * @var array<int, array<string, Type|string>>
55
- */
56
- private $ arguments ;
57
-
58
52
/** @var bool */
59
53
private $ isStatic ;
60
54
@@ -89,7 +83,6 @@ public function __construct(
89
83
$ arguments = $ this ->filterArguments ($ arguments );
90
84
91
85
$ this ->methodName = $ methodName ;
92
- $ this ->arguments = $ arguments ;
93
86
$ this ->returnType = $ returnType ;
94
87
$ this ->isStatic = $ static ;
95
88
$ this ->description = $ description ;
@@ -103,7 +96,11 @@ public static function create(
103
96
?DescriptionFactory $ descriptionFactory = null ,
104
97
?TypeContext $ context = null
105
98
): ?self {
106
- trigger_error ('Create using static factory is deprecated, this method should not be called directly by library consumers ' , E_USER_DEPRECATED );
99
+ trigger_error (
100
+ 'Create using static factory is deprecated, this method should not be called directly
101
+ by library consumers ' ,
102
+ E_USER_DEPRECATED
103
+ );
107
104
Assert::stringNotEmpty ($ body );
108
105
Assert::notNull ($ typeResolver );
109
106
Assert::notNull ($ descriptionFactory );
@@ -217,12 +214,21 @@ public function getMethodName(): string
217
214
}
218
215
219
216
/**
217
+ * @deprecated Method deprecated, use {@see self::getParameters()}
218
+ *
220
219
* @return array<int, array<string, Type|string>>
221
220
* @phpstan-return array<int, array{name: string, type: Type}>
222
221
*/
223
222
public function getArguments (): array
224
223
{
225
- return $ this ->arguments ;
224
+ trigger_error ('Method deprecated, use ::getParameters() ' , E_USER_DEPRECATED );
225
+
226
+ return array_map (
227
+ static function (MethodParameter $ methodParameter ) {
228
+ return ['name ' => $ methodParameter ->getName (), 'type ' => $ methodParameter ->getType ()];
229
+ },
230
+ $ this ->parameters
231
+ );
226
232
}
227
233
228
234
/** @return MethodParameter[] */
0 commit comments