diff --git a/framework/BaseYii.php b/framework/BaseYii.php index d00943fca51..258f4d4e4d3 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -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) { diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 370c9056d7d..e8b21ec4c4b 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -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