@@ -49,12 +49,6 @@ final class Method extends BaseTag implements Factory\StaticMethod
4949 /** @var string */
5050 private $ methodName ;
5151
52- /**
53- * @phpstan-var array<int, array{name: string, type: Type}>
54- * @var array<int, array<string, Type|string>>
55- */
56- private $ arguments ;
57-
5852 /** @var bool */
5953 private $ isStatic ;
6054
@@ -89,7 +83,6 @@ public function __construct(
8983 $ arguments = $ this ->filterArguments ($ arguments );
9084
9185 $ this ->methodName = $ methodName ;
92- $ this ->arguments = $ arguments ;
9386 $ this ->returnType = $ returnType ;
9487 $ this ->isStatic = $ static ;
9588 $ this ->description = $ description ;
@@ -103,7 +96,11 @@ public static function create(
10396 ?DescriptionFactory $ descriptionFactory = null ,
10497 ?TypeContext $ context = null
10598 ): ?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+ );
107104 Assert::stringNotEmpty ($ body );
108105 Assert::notNull ($ typeResolver );
109106 Assert::notNull ($ descriptionFactory );
@@ -217,12 +214,21 @@ public function getMethodName(): string
217214 }
218215
219216 /**
217+ * @deprecated Method deprecated, use {@see self::getParameters()}
218+ *
220219 * @return array<int, array<string, Type|string>>
221220 * @phpstan-return array<int, array{name: string, type: Type}>
222221 */
223222 public function getArguments (): array
224223 {
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+ );
226232 }
227233
228234 /** @return MethodParameter[] */
0 commit comments