diff --git a/src/DocBlock/Tags/Method.php b/src/DocBlock/Tags/Method.php index 701325d..bbb2062 100644 --- a/src/DocBlock/Tags/Method.php +++ b/src/DocBlock/Tags/Method.php @@ -49,12 +49,6 @@ final class Method extends BaseTag implements Factory\StaticMethod /** @var string */ private $methodName; - /** - * @phpstan-var array - * @var array> - */ - private $arguments; - /** @var bool */ private $isStatic; @@ -89,7 +83,6 @@ final class Method extends BaseTag implements Factory\StaticMethod $arguments = $this->filterArguments($arguments); $this->methodName = $methodName; - $this->arguments = $arguments; $this->returnType = $returnType; $this->isStatic = $static; $this->description = $description; @@ -103,7 +96,11 @@ final class Method extends BaseTag implements Factory\StaticMethod ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null ): ?self { - trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED); + trigger_error( + 'Create using static factory is deprecated, this method should not be called directly + by library consumers', + E_USER_DEPRECATED + ); Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -217,12 +214,21 @@ final class Method extends BaseTag implements Factory\StaticMethod } /** + * @deprecated Method deprecated, use {@see self::getParameters()} + * * @return array> * @phpstan-return array */ public function getArguments(): array { - return $this->arguments; + trigger_error('Method deprecated, use ::getParameters()', E_USER_DEPRECATED); + + return array_map( + static function (MethodParameter $methodParameter) { + return ['name' => $methodParameter->getName(), 'type' => $methodParameter->getType()]; + }, + $this->parameters + ); } /** @return MethodParameter[] */