diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02df822e..f9e05c03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Install PHP uses: shivammathur/setup-php@v2 with: @@ -26,7 +26,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} diff --git a/.gitignore b/.gitignore index 9ca9e4a4..fa9a7ab6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ # netbeans project files nbproject +# visual studio code project files +.vscode + # zend studio for eclipse project files .buildpath .project diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ca2626..bc8b4510 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Yii Framework 2 apidoc extension Change Log 3.0.8 under development ----------------------- -- no changes in this release. +- Bug #314: Fix deprecation error `Method deprecated, use ::getParameters()` (mspirkov) 3.0.7 February 13, 2025 diff --git a/models/TypeDoc.php b/models/TypeDoc.php index 23b32f8c..a064a98c 100644 --- a/models/TypeDoc.php +++ b/models/TypeDoc.php @@ -223,12 +223,12 @@ public function __construct($reflector = null, $context = null, $config = []) if ($tag instanceof Method) { $params = []; - foreach ($tag->getArguments() as $tagArgument) { - $argumentType = (string) $tagArgument['type']; + foreach ($tag->getParameters() as $parameter) { + $argumentType = (string) $parameter->getType(); $params[] = new ParamDoc(null, $context, [ 'sourceFile' => $this->sourceFile, - 'name' => $tagArgument['name'], + 'name' => $parameter->getName(), 'typeHint' => $argumentType, 'type' => $argumentType, 'types' => [], diff --git a/tests/commands/ApiControllerTest.php b/tests/commands/ApiControllerTest.php index 3354e0b8..01b857e0 100644 --- a/tests/commands/ApiControllerTest.php +++ b/tests/commands/ApiControllerTest.php @@ -118,6 +118,31 @@ public function testGenerateBootstrap() , $animalContent ); + $this->assertContainsWithoutIndent( + << +
Date as a UNIX timestamp.
+