mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-16 12:29:17 +08:00
Add generics for all controllers (#20675)
This commit is contained in:
@@ -9,6 +9,7 @@ namespace yii\web;
|
||||
|
||||
use Yii;
|
||||
use yii\base\InvalidRouteException;
|
||||
use yii\base\Module;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
@@ -58,6 +59,9 @@ class Application extends \yii\base\Application
|
||||
public $catchAll;
|
||||
/**
|
||||
* @var Controller|null the currently active controller instance
|
||||
*
|
||||
* @phpstan-var Controller<Module>|null
|
||||
* @psalm-var Controller<Module>|null
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ use yii\base\Exception;
|
||||
use yii\base\InlineAction;
|
||||
use yii\helpers\Url;
|
||||
use yii\base\Action;
|
||||
use yii\base\Controller as BaseController;
|
||||
use yii\base\Module;
|
||||
|
||||
/**
|
||||
* Controller is the base class of web controllers.
|
||||
@@ -24,8 +26,11 @@ use yii\base\Action;
|
||||
*
|
||||
* @author Qiang Xue <qiang.xue@gmail.com>
|
||||
* @since 2.0
|
||||
*
|
||||
* @template T of Module
|
||||
* @extends BaseController<T>
|
||||
*/
|
||||
class Controller extends \yii\base\Controller
|
||||
class Controller extends BaseController
|
||||
{
|
||||
/**
|
||||
* @var bool whether to enable CSRF validation for the actions in this controller.
|
||||
|
||||
Reference in New Issue
Block a user