Skip to content

Commit 3b1e920

Browse files
authored
PHPStan/Psalm annotations for Yii::getAlias (#20394)
1 parent 943da8c commit 3b1e920

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

framework/BaseYii.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public static function getVersion()
127127
* @return string|false the path corresponding to the alias, false if the root alias is not previously registered.
128128
* @throws InvalidArgumentException if the alias is invalid while $throwException is true.
129129
* @see setAlias()
130+
*
131+
* @phpstan-return ($throwException is true ? string : string|false)
132+
* @psalm-return ($throwException is true ? string : string|false)
130133
*/
131134
public static function getAlias($alias, $throwException = true)
132135
{

framework/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Yii Framework 2 Change Log
1818
- Enh #20372: Add PHPStan/Psalm annotations for `AssetBundle`, `AssetManager` and `View` (max-s-lab)
1919
- Bug #20373: Fixed the type of the first parameter `yii\base\Controller::bindInjectedParams()` (max-s-lab)
2020
- Enh #20374: Add PHPStan/Psalm annotations for `BaseYii`, `BaseObject`, `Component`, `Model`, `Module` and `yii\base\Controller` (max-s-lab)
21+
- Enh #20394: Add PHPStan/Psalm annotations for `Yii::getAlias` (max-s-lab)
2122

2223

2324
2.0.52 February 13, 2025

0 commit comments

Comments
 (0)