Fix #20671: Fix PHPDoc annotations in yii\base, yii\console, yii\web and yii\widgets namespaces

This commit is contained in:
Maksim Spirkov
2025-11-02 11:35:27 +03:00
committed by GitHub
parent d1556e323e
commit 1fdcebaeec
8 changed files with 14 additions and 13 deletions

View File

@@ -81,6 +81,7 @@ Yii Framework 2 Change Log
- Bug #20665: Fix PHP `8.5` `null` array offset deprecation warnings in `yii\build\controllers\ReleaseController` class (terabytesoftw)
- Bug #20658: Add missing generics in `yii\console`, `yii\captcha`, `yii\caching` and `yii\behaviors` namespaces (mspirkov)
- Bug #20666: Add missing generics in `yii\base`, `yii\console`, `yii\filters` and `yii\web` namespaces (mspirkov)
- Bug #20671: Fix PHPDoc annotations in `yii\base`, `yii\console`, `yii\web` and `yii\widgets` namespaces (mspirkov)
2.0.53 June 27, 2025

View File

@@ -113,7 +113,7 @@ abstract class Application extends Module
*/
public $sourceLanguage = 'en-US';
/**
* @var Controller the currently active controller instance
* @var Controller|null the currently active controller instance
*/
public $controller;
/**

View File

@@ -75,7 +75,7 @@ class Application extends \yii\base\Application
*/
public $enableCoreCommands = true;
/**
* @var Controller the currently active controller instance
* @var Controller|null the currently active controller instance
*/
public $controller;

View File

@@ -57,7 +57,7 @@ class Application extends \yii\base\Application
*/
public $catchAll;
/**
* @var Controller the currently active controller instance
* @var Controller|null the currently active controller instance
*/
public $controller;

View File

@@ -51,7 +51,7 @@ abstract class BaseListView extends Widget
*/
public $sorter = [];
/**
* @var string the HTML content to be displayed as the summary of the list view.
* @var string|null the HTML content to be displayed as the summary of the list view.
* If you do not want to show the summary, you may set it with an empty string.
*
* The following tokens will be replaced with the corresponding values:
@@ -77,7 +77,7 @@ abstract class BaseListView extends Widget
*/
public $showOnEmpty = false;
/**
* @var string|false the HTML content to be displayed when [[dataProvider]] does not have any data.
* @var string|false|null the HTML content to be displayed when [[dataProvider]] does not have any data.
* When this is set to `false` no extra HTML content will be generated.
* The default value is the text "No results found." which will be translated to the current application language.
* @see showOnEmpty

View File

@@ -75,7 +75,7 @@ class ListView extends BaseListView
*/
public $options = ['class' => 'list-view'];
/**
* @var Closure an anonymous function that is called once BEFORE rendering each data model.
* @var Closure|null an anonymous function that is called once BEFORE rendering each data model.
* It should have the following signature:
*
* ```
@@ -94,7 +94,7 @@ class ListView extends BaseListView
*/
public $beforeItem;
/**
* @var Closure an anonymous function that is called once AFTER rendering each data model.
* @var Closure|null an anonymous function that is called once AFTER rendering each data model.
*
* It should have the same signature as [[beforeItem]].
*

View File

@@ -64,7 +64,7 @@ class MaskedInput extends InputWidget
*/
public $mask;
/**
* @var array custom mask definitions to use. Should be configured as `maskSymbol => settings`, where
* @var array|null custom mask definitions to use. Should be configured as `maskSymbol => settings`, where
*
* - `maskSymbol` is a string, containing a character to identify your mask definition and
* - `settings` is an array, consisting of the following entries:
@@ -75,7 +75,7 @@ class MaskedInput extends InputWidget
*/
public $definitions;
/**
* @var array custom aliases to use. Should be configured as `maskAlias => settings`, where
* @var array|null custom aliases to use. Should be configured as `maskAlias => settings`, where
*
* - `maskAlias` is a string containing a text to identify your mask alias definition (e.g. 'phone') and
* - `settings` is an array containing settings for the mask symbol, exactly similar to parameters as passed in [[clientOptions]].
@@ -99,7 +99,7 @@ class MaskedInput extends InputWidget
public $type = 'text';
/**
* @var string the hashed variable to store the pluginOptions
* @var string|null the hashed variable to store the pluginOptions
*/
protected $_hashVar;
/**
@@ -196,10 +196,10 @@ class MaskedInput extends InputWidget
$this->clientOptions['mask'] = $this->mask;
}
$this->hashPluginOptions($view);
if (!empty($this->definitions) && is_array($this->definitions)) {
if (is_array($this->definitions) && !empty($this->definitions)) {
$js .= ucfirst(self::PLUGIN_NAME) . '.extendDefinitions(' . Json::htmlEncode($this->definitions) . ');';
}
if (!empty($this->aliases) && is_array($this->aliases)) {
if (is_array($this->aliases) && !empty($this->aliases)) {
$js .= ucfirst(self::PLUGIN_NAME) . '.extendAliases(' . Json::htmlEncode($this->aliases) . ');';
}
$id = $this->options['id'];

View File

@@ -406,6 +406,6 @@ parameters:
path: framework/caching/Dependency.php
-
message: "#^Property yii\\\\console\\\\Application\\:\\:\\$controller \\(yii\\\\console\\\\Controller\\|yii\\\\web\\\\Controller\\) does not accept yii\\\\base\\\\Controller\\.$#"
message: "#^Property yii\\\\console\\\\Application\\:\\:\\$controller \\(yii\\\\console\\\\Controller\\|yii\\\\web\\\\Controller\\|null\\) does not accept yii\\\\base\\\\Controller\\.$#"
count: 1
path: framework/base/Module.php