mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fix PHPStan errors (#20523)
This commit is contained in:
@ -436,7 +436,7 @@ class ReleaseController extends Controller
|
|||||||
$this->stdout("done.\n", Console::FG_GREEN, Console::BOLD);
|
$this->stdout("done.\n", Console::FG_GREEN, Console::BOLD);
|
||||||
|
|
||||||
$this->stdout('updating mimetype magic file and mime aliases...', Console::BOLD);
|
$this->stdout('updating mimetype magic file and mime aliases...', Console::BOLD);
|
||||||
$this->dryRun || Yii::$app->runAction('mime-type', ["$frameworkPath/helpers/mimeTypes.php"], ["$frameworkPath/helpers/mimeAliases.php"]);
|
$this->dryRun || Yii::$app->runAction('mime-type', ["$frameworkPath/helpers/mimeTypes.php"]);
|
||||||
$this->stdout("done.\n", Console::FG_GREEN, Console::BOLD);
|
$this->stdout("done.\n", Console::FG_GREEN, Console::BOLD);
|
||||||
|
|
||||||
$this->stdout("fixing various PHPDoc style issues...\n", Console::BOLD);
|
$this->stdout("fixing various PHPDoc style issues...\n", Console::BOLD);
|
||||||
|
|||||||
@ -8,6 +8,10 @@ use yii\helpers\Html;
|
|||||||
* @var string $sourcePath
|
* @var string $sourcePath
|
||||||
* @var string $translationPath
|
* @var string $translationPath
|
||||||
* @var array $results
|
* @var array $results
|
||||||
|
*
|
||||||
|
* @phpstan-var \yii\web\View&object{
|
||||||
|
* context: \yii\build\controllers\TranslationController,
|
||||||
|
* } $this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
?><!doctype html>
|
?><!doctype html>
|
||||||
|
|||||||
@ -675,6 +675,7 @@ class Container extends Component
|
|||||||
$class = $param->getType();
|
$class = $param->getType();
|
||||||
if ($class instanceof \ReflectionUnionType || (PHP_VERSION_ID >= 80100 && $class instanceof \ReflectionIntersectionType)) {
|
if ($class instanceof \ReflectionUnionType || (PHP_VERSION_ID >= 80100 && $class instanceof \ReflectionIntersectionType)) {
|
||||||
$isClass = false;
|
$isClass = false;
|
||||||
|
/** @var ReflectionNamedType $type */
|
||||||
foreach ($class->getTypes() as $type) {
|
foreach ($class->getTypes() as $type) {
|
||||||
if (!$type->isBuiltin()) {
|
if (!$type->isBuiltin()) {
|
||||||
$class = $type;
|
$class = $type;
|
||||||
@ -683,6 +684,7 @@ class Container extends Component
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
/** @var ReflectionNamedType|null $class */
|
||||||
$isClass = $class !== null && !$class->isBuiltin();
|
$isClass = $class !== null && !$class->isBuiltin();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -319,6 +319,8 @@ class YiiRequirementChecker
|
|||||||
} else {
|
} else {
|
||||||
require $_viewFile_;
|
require $_viewFile_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class InlineValidator extends Validator
|
|||||||
if (is_string($method)) {
|
if (is_string($method)) {
|
||||||
$method = [$model, $method];
|
$method = [$model, $method];
|
||||||
} elseif ($method instanceof \Closure) {
|
} elseif ($method instanceof \Closure) {
|
||||||
$method = $this->method->bindTo($model);
|
$method = $method->bindTo($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
$current = $this->current;
|
$current = $this->current;
|
||||||
|
|||||||
@ -52,7 +52,10 @@ class Controller extends \yii\base\Controller
|
|||||||
*/
|
*/
|
||||||
public function renderAjax($view, $params = [])
|
public function renderAjax($view, $params = [])
|
||||||
{
|
{
|
||||||
return $this->getView()->renderAjax($view, $params, $this);
|
/** @var View */
|
||||||
|
$viewComponent = $this->getView();
|
||||||
|
|
||||||
|
return $viewComponent->renderAjax($view, $params, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user