From 8e8566bc3609de55ae6d2ecef3603fb83527c08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=BF=D0=B8?= =?UTF-8?q?=D1=80=D0=BA=D0=BE=D0=B2?= Date: Sun, 16 Nov 2025 20:04:26 +0400 Subject: [PATCH 1/2] Fix parameter types in the `@method` annotation --- CHANGELOG.md | 1 + models/TypeDoc.php | 2 +- .../ApiControllerTest__testGenerateBootstrap__1.html | 10 ++++++++-- .../ApiControllerTest__testGenerateBootstrap__2.html | 10 ++++++++-- .../ApiControllerTest__testGenerateBootstrap__3.html | 10 ++++++++-- tests/data/api/animal/Animal.php | 2 +- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ddaf4a..143de86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Yii Framework 2 apidoc extension Change Log - Bug #311: Support `nikic/php-parser` v5 (mspirkov) - Bug #324: Raise minimum PHP version to 7.4 (mspirkov) - Bug #325: Fix deprecation errors `The Default value will become of type Expression by default` (mspirkov) +- Bug #329: Fix getting parameter types in the `@method` annotation (mspirkov) 3.0.7 February 13, 2025 diff --git a/models/TypeDoc.php b/models/TypeDoc.php index 8e99cd5..cdb7957 100644 --- a/models/TypeDoc.php +++ b/models/TypeDoc.php @@ -231,7 +231,7 @@ public function __construct($reflector = null, $context = null, $config = []) 'name' => $parameter->getName(), 'typeHint' => $argumentType, 'type' => $argumentType, - 'types' => [], + 'types' => [$argumentType], ]); } diff --git a/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__1.html b/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__1.html index febfd20..4bfa281 100644 --- a/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__1.html +++ b/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__1.html @@ -387,11 +387,17 @@

Method Details

+publicintegergetSomething ( $test, integer$test2 ) - + + + + + + diff --git a/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__2.html b/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__2.html index d2064fe..be0e558 100644 --- a/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__2.html +++ b/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__2.html @@ -273,11 +273,17 @@

Method Details

-public integer getSomething ( $test )
$testmixed +
$test2integer
+publicintegergetSomething ( $test, integer$test2 ) - + + + + + + diff --git a/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__3.html b/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__3.html index d3fa87b..6a453ef 100644 --- a/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__3.html +++ b/tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__3.html @@ -268,11 +268,17 @@

Method Details

-public integer getSomething ( $test )
$testmixed +
$test2integer
+publicintegergetSomething ( $test, integer$test2 ) - + + + + + + diff --git a/tests/data/api/animal/Animal.php b/tests/data/api/animal/Animal.php index 63e2238..95f18d6 100644 --- a/tests/data/api/animal/Animal.php +++ b/tests/data/api/animal/Animal.php @@ -14,7 +14,7 @@ * * @property int $age animal age in seconds. * - * @method int getSomething($test) + * @method int getSomething($test, int $test2) * * @author Paul Klimov * @since 1.0 From 25f263df14d97daf2e1ec3d8fa7e546e4f756473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=BF=D0=B8?= =?UTF-8?q?=D1=80=D0=BA=D0=BE=D0=B2?= Date: Sun, 16 Nov 2025 20:10:54 +0400 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb2409..905e29e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Yii Framework 2 apidoc extension Change Log - Bug #324: Raise minimum PHP version to 7.4 (mspirkov) - Bug #325: Fix deprecation errors `The Default value will become of type Expression by default` (mspirkov) - Bug #327: Fix deprecation errors `The expression value will become of type Expression by default` (mspirkov) -- Bug #329: Fix getting parameter types in the `@method` annotation (mspirkov) +- Bug #329: Fix getting parameter types from the `@method` annotation (mspirkov) 3.0.7 February 13, 2025
-public integer getSomething ( $test )
$testmixed +
$test2integer