From 68600dbcba3e7f5af29b251f1d0e8619fb011990 Mon Sep 17 00:00:00 2001 From: Maksim Spirkov <63721828+max-s-lab@users.noreply.github.com> Date: Mon, 15 Sep 2025 21:37:32 +0400 Subject: [PATCH] Fix #20524: Fix PHPStan/Psalm annotations in `Yii::createObject` --- framework/BaseYii.php | 4 ++-- framework/CHANGELOG.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/BaseYii.php b/framework/BaseYii.php index 68ed62abc4..cb7ac56e8e 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -343,8 +343,8 @@ class BaseYii * @see \yii\di\Container * * @template T - * @phpstan-param class-string|array{class: class-string, ...}|callable(): T $type - * @psalm-param class-string|array{class: class-string, ...}|callable(): T $type + * @phpstan-param class-string|array{class?: class-string, __class?: class-string, ...}|callable(): T $type + * @psalm-param class-string|array{class?: class-string, __class?: class-string, ...}|callable(): T $type * @phpstan-return T * @psalm-return T */ diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 75e8e3fdbb..3ed08d9382 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -28,6 +28,7 @@ Yii Framework 2 Change Log - Enh #20514: Add `@property` annotations for `yii\console\Controller` (max-s-lab) - Bug #20515: Fix `@param` annotations in `BetweenColumnsCondition`, `InCondition` and `LikeCondition` (max-s-lab) - Bug #20516: Fix `@template` annotations in `ActiveRecord` (max-s-lab) +- Bug #20524: Fix PHPStan/Psalm annotations in `Yii::createObject` (max-s-lab) 2.0.53 June 27, 2025