mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-31 02:28:35 +08:00
Fix PHPStan errors (#20609)
This commit is contained in:
@ -90,7 +90,7 @@ class Widget extends Component implements ViewContextInterface
|
||||
public static function begin($config = [])
|
||||
{
|
||||
$config['class'] = get_called_class();
|
||||
/** @var self $widget */
|
||||
/** @var static $widget */
|
||||
$widget = Yii::createObject($config);
|
||||
self::$stack[] = $widget;
|
||||
self::$_resolvedClasses[get_called_class()] = get_class($widget);
|
||||
@ -113,7 +113,7 @@ class Widget extends Component implements ViewContextInterface
|
||||
$calledClass = self::$_resolvedClasses[get_called_class()] ?? get_called_class();
|
||||
|
||||
if (get_class($widget) === $calledClass) {
|
||||
/** @var self $widget */
|
||||
/** @var static $widget */
|
||||
if ($widget->beforeRun()) {
|
||||
$result = $widget->run();
|
||||
$result = $widget->afterRun($result);
|
||||
|
||||
@ -65,7 +65,7 @@ class CaptchaValidator extends Validator
|
||||
|
||||
/**
|
||||
* Creates the CAPTCHA action object from the route specified by [[captchaAction]].
|
||||
* @return \yii\captcha\CaptchaAction the action object
|
||||
* @return CaptchaAction the action object
|
||||
* @throws InvalidConfigException
|
||||
*/
|
||||
public function createCaptchaAction()
|
||||
@ -74,6 +74,7 @@ class CaptchaValidator extends Validator
|
||||
if ($ca !== false) {
|
||||
/** @var \yii\base\Controller $controller */
|
||||
list($controller, $actionID) = $ca;
|
||||
/** @var CaptchaAction|null */
|
||||
$action = $controller->createAction($actionID);
|
||||
if ($action !== null) {
|
||||
return $action;
|
||||
|
||||
@ -139,7 +139,7 @@ class Pagination extends BaseObject implements Linkable
|
||||
public $pageSizeLimit = [1, 50];
|
||||
|
||||
/**
|
||||
* @var int number of items on each page.
|
||||
* @var int|null number of items on each page.
|
||||
* If it is less than 1, it means the page size is infinite, and thus a single page contains all items.
|
||||
*/
|
||||
private $_pageSize;
|
||||
|
||||
@ -100,7 +100,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont
|
||||
public $fileTransportCallback;
|
||||
|
||||
/**
|
||||
* @var \yii\base\View|array view instance or its array configuration.
|
||||
* @var View|array view instance or its array configuration.
|
||||
*/
|
||||
private $_view = [];
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user