Skip to content

PHPStan/Psalm annotations for Yii::getAlias #20394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions framework/BaseYii.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public static function getVersion()
* @return string|false the path corresponding to the alias, false if the root alias is not previously registered.
* @throws InvalidArgumentException if the alias is invalid while $throwException is true.
* @see setAlias()
*
* @phpstan-return ($throwException is true ? string : string|false)
* @psalm-return ($throwException is true ? string : string|false)
*/
public static function getAlias($alias, $throwException = true)
{
Expand Down
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Yii Framework 2 Change Log
- Enh #20372: Add PHPStan/Psalm annotations for `AssetBundle`, `AssetManager` and `View` (max-s-lab)
- Bug #20373: Fixed the type of the first parameter `yii\base\Controller::bindInjectedParams()` (max-s-lab)
- Enh #20374: Add PHPStan/Psalm annotations for `BaseYii`, `BaseObject`, `Component`, `Model`, `Module` and `yii\base\Controller` (max-s-lab)
- Enh #20394: Add PHPStan/Psalm annotations for `Yii::getAlias` (max-s-lab)


2.0.52 February 13, 2025
Expand Down