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('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("fixing various PHPDoc style issues...\n", Console::BOLD);
|
||||
|
||||
@ -8,6 +8,10 @@ use yii\helpers\Html;
|
||||
* @var string $sourcePath
|
||||
* @var string $translationPath
|
||||
* @var array $results
|
||||
*
|
||||
* @phpstan-var \yii\web\View&object{
|
||||
* context: \yii\build\controllers\TranslationController,
|
||||
* } $this
|
||||
*/
|
||||
|
||||
?><!doctype html>
|
||||
|
||||
@ -675,6 +675,7 @@ class Container extends Component
|
||||
$class = $param->getType();
|
||||
if ($class instanceof \ReflectionUnionType || (PHP_VERSION_ID >= 80100 && $class instanceof \ReflectionIntersectionType)) {
|
||||
$isClass = false;
|
||||
/** @var ReflectionNamedType $type */
|
||||
foreach ($class->getTypes() as $type) {
|
||||
if (!$type->isBuiltin()) {
|
||||
$class = $type;
|
||||
@ -683,6 +684,7 @@ class Container extends Component
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/** @var ReflectionNamedType|null $class */
|
||||
$isClass = $class !== null && !$class->isBuiltin();
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -319,6 +319,8 @@ class YiiRequirementChecker
|
||||
} else {
|
||||
require $_viewFile_;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -67,7 +67,7 @@ class InlineValidator extends Validator
|
||||
if (is_string($method)) {
|
||||
$method = [$model, $method];
|
||||
} elseif ($method instanceof \Closure) {
|
||||
$method = $this->method->bindTo($model);
|
||||
$method = $method->bindTo($model);
|
||||
}
|
||||
|
||||
$current = $this->current;
|
||||
|
||||
@ -52,7 +52,10 @@ class Controller extends \yii\base\Controller
|
||||
*/
|
||||
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