From 4774464159669eccca286ae2d67007e1ac2eff2f Mon Sep 17 00:00:00 2001 From: Maksim Spirkov <63721828+max-s-lab@users.noreply.github.com> Date: Mon, 15 Sep 2025 21:38:24 +0400 Subject: [PATCH] Fix #20525: Add `@template` annotations for all actions --- framework/CHANGELOG.md | 1 + framework/base/InlineAction.php | 3 +++ framework/captcha/CaptchaAction.php | 4 ++++ framework/rest/CreateAction.php | 3 +++ framework/rest/DeleteAction.php | 3 +++ framework/rest/IndexAction.php | 3 +++ framework/rest/UpdateAction.php | 3 +++ framework/rest/ViewAction.php | 3 +++ framework/web/ErrorAction.php | 3 +++ framework/web/ViewAction.php | 3 +++ 10 files changed, 29 insertions(+) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 3ed08d9382..eaa5911b15 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) +- Enh #20525: Add `@template` annotations for all actions (max-s-lab) - Bug #20524: Fix PHPStan/Psalm annotations in `Yii::createObject` (max-s-lab) diff --git a/framework/base/InlineAction.php b/framework/base/InlineAction.php index 6e6b1be02f..13f57ad724 100644 --- a/framework/base/InlineAction.php +++ b/framework/base/InlineAction.php @@ -19,6 +19,9 @@ use Yii; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class InlineAction extends Action { diff --git a/framework/captcha/CaptchaAction.php b/framework/captcha/CaptchaAction.php index 1518d0904d..79086e0535 100644 --- a/framework/captcha/CaptchaAction.php +++ b/framework/captcha/CaptchaAction.php @@ -11,6 +11,7 @@ use Yii; use yii\base\Action; use yii\base\InvalidConfigException; use yii\helpers\Url; +use yii\web\Controller; use yii\web\Response; /** @@ -35,6 +36,9 @@ use yii\web\Response; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class CaptchaAction extends Action { diff --git a/framework/rest/CreateAction.php b/framework/rest/CreateAction.php index 0dab7044f7..30481f40c0 100644 --- a/framework/rest/CreateAction.php +++ b/framework/rest/CreateAction.php @@ -19,6 +19,9 @@ use yii\web\ServerErrorHttpException; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class CreateAction extends Action { diff --git a/framework/rest/DeleteAction.php b/framework/rest/DeleteAction.php index 43ad64bcc7..18b8964f0a 100644 --- a/framework/rest/DeleteAction.php +++ b/framework/rest/DeleteAction.php @@ -17,6 +17,9 @@ use yii\web\ServerErrorHttpException; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class DeleteAction extends Action { diff --git a/framework/rest/IndexAction.php b/framework/rest/IndexAction.php index 7cba1493c2..2b4f5ff47c 100644 --- a/framework/rest/IndexAction.php +++ b/framework/rest/IndexAction.php @@ -21,6 +21,9 @@ use yii\helpers\ArrayHelper; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class IndexAction extends Action { diff --git a/framework/rest/UpdateAction.php b/framework/rest/UpdateAction.php index 62cbf5e4be..03b7d32af7 100644 --- a/framework/rest/UpdateAction.php +++ b/framework/rest/UpdateAction.php @@ -19,6 +19,9 @@ use yii\web\ServerErrorHttpException; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class UpdateAction extends Action { diff --git a/framework/rest/ViewAction.php b/framework/rest/ViewAction.php index 901fa6beec..f4e9a18fbb 100644 --- a/framework/rest/ViewAction.php +++ b/framework/rest/ViewAction.php @@ -14,6 +14,9 @@ namespace yii\rest; * * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class ViewAction extends Action { diff --git a/framework/web/ErrorAction.php b/framework/web/ErrorAction.php index efff06b475..d146dfddd6 100644 --- a/framework/web/ErrorAction.php +++ b/framework/web/ErrorAction.php @@ -47,6 +47,9 @@ use yii\base\UserException; * @author Qiang Xue * @author Dmitry Naumenko * @since 2.0 + * + * @template T of Controller + * @extends Action */ class ErrorAction extends Action { diff --git a/framework/web/ViewAction.php b/framework/web/ViewAction.php index 26435f3785..a6bd51be3f 100644 --- a/framework/web/ViewAction.php +++ b/framework/web/ViewAction.php @@ -27,6 +27,9 @@ use yii\base\ViewNotFoundException; * @author Alexander Makarov * @author Qiang Xue * @since 2.0 + * + * @template T of Controller + * @extends Action */ class ViewAction extends Action {