Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@
/phpcs.xml.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.dist.neon export-ignore
/phpunit-7x.xml.dist export-ignore
/phpunit.xml.dist export-ignore
10 changes: 1 addition & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,9 @@ on:
push: *ignore-paths

jobs:
phpunit-7x:
uses: yiisoft/yii2-actions/.github/workflows/phpunit.yml@master
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
php-version: '["7.4"]'
phpunit-configuration: phpunit-7x.xml.dist

phpunit:
uses: yiisoft/yii2-actions/.github/workflows/phpunit.yml@master
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
php-version: '["8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]'
php-version: '["8.2", "8.3", "8.4", "8.5"]'
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
phpcs:
uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master
with:
directories: commands/ components/ helpers/ models/ renderers/ templates/ tests/
php-version: '["8.2", "8.5"]'
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
phpstan:
uses: yiisoft/yii2-actions/.github/workflows/phpstan.yml@master
with:
php-version: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]'
configuration: phpstan.dist.neon
php-version: '["8.2", "8.5"]'
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Yii Framework 2 apidoc extension Change Log

- Bug #338: Fix deprecation error `Using null as an array offset is deprecated, use an empty string instead` (mspirkov)
- Enh #337: Log invalid tags (mspirkov)
- Enh #339, #340, #351, #368: Add support for PHPStan/Psalm syntax (mspirkov)
- Enh #339, #340, #351, #368, #377: Add support for PHPStan/Psalm syntax (mspirkov)
- Enh #339: Add support for intersection types (mspirkov)
- Bug #339: Fix the mechanism for replacing `static` with FQCN (mspirkov)
- Bug #339: Fix processing of multidimensional arrays (mspirkov)
Expand All @@ -31,6 +31,9 @@ Yii Framework 2 apidoc extension Change Log
- Chg #373: Move `BaseDoc::extractFirstSentence()` to `TextHelper::extractFirstSentence()` (mspirkov)
- Bug #283: Fix extracting the first sentence from the text (mspirkov)
- Enh #244: Uniform processing and output of descriptions for methods and properties (mspirkov)
- Enh #377: Raise minimum PHP version to 8.2 (mspirkov)
- Enh #377: Raise minimum `phpdocumentor/type-resolver` version to 2.0 (mspirkov)
- Enh #377: Raise minimum `nikic/php-parser` version to 5.0 (mspirkov)
Comment thread
samdark marked this conversation as resolved.
Outdated


3.0.8 November 24, 2025
Expand All @@ -41,7 +44,7 @@ Yii Framework 2 apidoc extension Change Log
- Bug #313: Fix deprecation error `Method deprecated, use ::getParameters()` (mspirkov)
- Bug #317: Fix `trim` deprecation errors `Passing null to parameter #1 ($string) of type string is deprecated` (mspirkov)
- Bug #318: Fix deprecation errors `mb_convert_encoding(): Handling HTML entities via mbstring is deprecated` (mspirkov)
- Bug #324: Raise minimum PHP version to 7.4 (mspirkov)
- Enh #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, #331: Fix getting parameter types from the `@method` annotation (mspirkov)
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ For license information check the [LICENSE](LICENSE.md)-file.

## Installation

Comment thread
mspirkov marked this conversation as resolved.
> [!IMPORTANT]
>
> - The minimum required [PHP](https://www.php.net/) version is PHP `7.4`.
> - It works best with PHP `8`.

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run
Expand Down
18 changes: 12 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
"php": "^7.4 || ^8.0",
"php": "^8.2",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP 7.4.33 is used at yiiframework.com still.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to update it at the server...

"yiisoft/yii2": "~2.0.16",
"phpdocumentor/reflection": "^5.3.0 || ^6.0.0",
"phpdocumentor/type-resolver": "^1.12",
"nikic/php-parser": "^4.0 || ^5.0",
"phpdocumentor/reflection": "7.x-dev",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, we're using this version. Later, I'll replace it with ^7.0.

Comment thread
mspirkov marked this conversation as resolved.
"phpdocumentor/type-resolver": "^2.0",
"nikic/php-parser": "^5.0",
"cebe/js-search": "~0.9.0",
"cebe/markdown": "^1.0",
"cebe/markdown-latex": "^1.0",
"scrivo/highlight.php": "^9.0"
},
"require-dev": {
"yiisoft/yii2-bootstrap": "~2.0.0",
"phpunit/phpunit": "^9.6 || ^10.0",
"spatie/phpunit-snapshot-assertions": "^4.2 || ^5.0",
"phpunit/phpunit": "^11.5",
"spatie/phpunit-snapshot-assertions": "^5.0",
"phpstan/phpstan": "^2.1",
"yiisoft/yii2-coding-standards": "^3.0"
},
Expand Down Expand Up @@ -64,5 +64,11 @@
"allow-plugins": {
"yiisoft/yii2-composer": true
}
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cs-fix": "./vendor/bin/phpcbf",
"static": "./vendor/bin/phpstan --memory-limit=-1",
"tests": "./vendor/bin/phpunit"
}
}
8 changes: 2 additions & 6 deletions models/ConstDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ public function __construct($parent, $reflector = null, $context = null, $config
return;
}

if (PHP_VERSION_ID >= 80100) {
$reflectorValue = $reflector->getValue(false);
$this->value = $reflectorValue !== null ? (string) $reflectorValue : null;
} else {
$this->value = $reflector->getValue();
}
$reflectorValue = $reflector->getValue(false);
$this->value = $reflectorValue !== null ? (string) $reflectorValue : null;
}
}
8 changes: 2 additions & 6 deletions models/ParamDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,8 @@ public function __construct($parent, $reflector = null, $context = null, $config
$this->type = $reflector->getType();
}

if (PHP_VERSION_ID >= 80100) {
$reflectorDefault = $reflector->getDefault(false);
$this->defaultValue = $reflectorDefault !== null ? (string) $reflectorDefault : null;
} else {
$this->defaultValue = $reflector->getDefault();
}
$reflectorDefault = $reflector->getDefault(false);
$this->defaultValue = $reflectorDefault !== null ? (string) $reflectorDefault : null;

$this->isOptional = $this->defaultValue !== null;
$this->isPassedByReference = $reflector->isByReference();
Expand Down
8 changes: 2 additions & 6 deletions models/PropertyDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,8 @@ public function __construct($parent, $reflector = null, $context = null, $config
$this->visibility = (string) $reflector->getVisibility();
$this->isStatic = $reflector->isStatic();

if (PHP_VERSION_ID >= 80100) {
$reflectorDefault = $reflector->getDefault(false);
$this->defaultValue = $reflectorDefault !== null ? (string) $reflectorDefault : null;
} else {
$this->defaultValue = $reflector->getDefault();
}
$reflectorDefault = $reflector->getDefault(false);
$this->defaultValue = $reflectorDefault !== null ? (string) $reflectorDefault : null;

$hasInheritdoc = false;
foreach ($this->tags as $tag) {
Expand Down
14 changes: 8 additions & 6 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>

<!-- display progress -->
<arg value="p"/>
<!-- Show error codes -->
<arg value="s"/>
<arg name="colors"/>

<!-- generate relative paths -->
<arg name="basepath" value="."/>

<file>commands</file>
<file>components</file>
<file>helpers</file>
<file>models</file>
<file>renderers</file>
<file>templates</file>
<file>tests</file>

<exclude-pattern>templates/*/views/*</exclude-pattern>
<exclude-pattern>templates/*/layouts/*</exclude-pattern>
</ruleset>
17 changes: 0 additions & 17 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,3 @@ parameters:
count: 1
path: helpers/ApiMarkdown.php

-
message: "#^Method phpDocumentor\\\\Reflection\\\\Php\\\\Property\\:\\:getDefault\\(\\) invoked with 1 parameter\\, 0 required\\.$#"
count: 1
reportUnmatched: false
path: models/PropertyDoc.php

-
message: "#^Method phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\:\\:getDefault\\(\\) invoked with 1 parameter\\, 0 required\\.$#"
count: 1
reportUnmatched: false
path: models/ParamDoc.php

-
message: "#^Method phpDocumentor\\\\Reflection\\\\Php\\\\Constant\\:\\:getValue\\(\\) invoked with 1 parameter\\, 0 required\\.$#"
count: 1
reportUnmatched: false
path: models/ConstDoc.php
28 changes: 0 additions & 28 deletions phpunit-7x.xml.dist

This file was deleted.

Loading
Loading