mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-13 08:43:42 +08:00
Fix PHPStan errors (#20738)
This commit is contained in:
@@ -14,6 +14,9 @@ Yii Framework 2 Change Log
|
||||
- Bug #20733: Replace `$this` with `static` and `covariant static` in generics in PHPStan and PHPDoc annotations (mspirkov)
|
||||
- Bug #20735: Fix `@param` annotations for `$name` in `Request::get()` and `Request::post()` (mspirkov)
|
||||
- Enh #20735: Add conditional types in `@return` annotations in `Request::get()` and `Request::post()` (mspirkov)
|
||||
- Bug #20738: Fix `@var` annotations for `Application::$requestedParams`, `AssetBundle::$basePath`, `AssetBundle::$baseUrl`, `MultiFieldSession::$writeCallback` (mspirkov)
|
||||
- Bug #20738: Fix `@return` annotations for `User::getAuthManager()` and `User::getAccessChecker()` (mspirkov)
|
||||
- Bug #20738: Fix `@param` annotation for `$value` parameter in `AssetManager::setConverter()` (mspirkov)
|
||||
|
||||
|
||||
2.0.54 January 09, 2026
|
||||
|
||||
@@ -130,7 +130,7 @@ abstract class Application extends Module
|
||||
*/
|
||||
public $requestedAction;
|
||||
/**
|
||||
* @var array the parameters supplied to the requested action.
|
||||
* @var array|null the parameters supplied to the requested action.
|
||||
*/
|
||||
public $requestedParams;
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@ class AssetBundle extends BaseObject
|
||||
*/
|
||||
public $sourcePath;
|
||||
/**
|
||||
* @var string the Web-accessible directory that contains the asset files in this bundle.
|
||||
* @var string|null the Web-accessible directory that contains the asset files in this bundle.
|
||||
*
|
||||
* If [[sourcePath]] is set, this property will be *overwritten* by [[AssetManager]]
|
||||
* when it publishes the asset files from [[sourcePath]].
|
||||
@@ -58,7 +58,7 @@ class AssetBundle extends BaseObject
|
||||
*/
|
||||
public $basePath;
|
||||
/**
|
||||
* @var string the base URL for the relative asset files listed in [[js]] and [[css]].
|
||||
* @var string|null the base URL for the relative asset files listed in [[js]] and [[css]].
|
||||
*
|
||||
* If [[sourcePath]] is set, this property will be *overwritten* by [[AssetManager]]
|
||||
* when it publishes the asset files from [[sourcePath]].
|
||||
|
||||
@@ -393,7 +393,7 @@ class AssetManager extends Component
|
||||
}
|
||||
|
||||
/**
|
||||
* @var AssetConverterInterface
|
||||
* @var array|string|AssetConverterInterface|null
|
||||
*/
|
||||
private $_converter;
|
||||
|
||||
@@ -417,9 +417,9 @@ class AssetManager extends Component
|
||||
|
||||
/**
|
||||
* Sets the asset converter.
|
||||
* @param array|AssetConverterInterface $value the asset converter. This can be either
|
||||
* @param array|string|AssetConverterInterface $value the asset converter. This can be either
|
||||
* an object implementing the [[AssetConverterInterface]], or a configuration
|
||||
* array that can be used to create the asset converter object.
|
||||
* array that can be used to create the asset converter object, or a class name.
|
||||
*/
|
||||
public function setConverter($value)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ abstract class MultiFieldSession extends Session
|
||||
*/
|
||||
public $readCallback;
|
||||
/**
|
||||
* @var callable a callback that will be called during session data writing.
|
||||
* @var callable|null a callback that will be called during session data writing.
|
||||
* The signature of the callback should be as follows:
|
||||
*
|
||||
* ```
|
||||
|
||||
@@ -794,7 +794,7 @@ class User extends Component
|
||||
*
|
||||
* By default this is the `authManager` application component.
|
||||
* You may override this method to return a different auth manager instance if needed.
|
||||
* @return \yii\rbac\ManagerInterface
|
||||
* @return \yii\rbac\ManagerInterface|null
|
||||
* @since 2.0.6
|
||||
* @deprecated since version 2.0.9, to be removed in 2.1. Use [[getAccessChecker()]] instead.
|
||||
*/
|
||||
@@ -805,7 +805,7 @@ class User extends Component
|
||||
|
||||
/**
|
||||
* Returns the access checker used for checking access.
|
||||
* @return CheckAccessInterface
|
||||
* @return CheckAccessInterface|null
|
||||
* @since 2.0.9
|
||||
*/
|
||||
protected function getAccessChecker()
|
||||
|
||||
@@ -534,7 +534,7 @@ class View extends \yii\base\View
|
||||
$trimmedUrl = ltrim((substr($url, 0, $prefixLength) === $prefix) ? substr($url, $prefixLength) : $url, '/');
|
||||
$timestamp = @filemtime(Yii::getAlias('@webroot/' . $trimmedUrl, false));
|
||||
if ($timestamp > 0) {
|
||||
$url = $timestamp ? "$url?v=$timestamp" : $url;
|
||||
$url = "$url?v=$timestamp";
|
||||
}
|
||||
}
|
||||
if ($type === 'js') {
|
||||
|
||||
Reference in New Issue
Block a user