-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Fix PHPStan errors #20523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHPStan errors #20523
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,10 @@ | |
| * @var string $sourcePath | ||
| * @var string $translationPath | ||
| * @var array $results | ||
| * | ||
| * @phpstan-var \yii\web\View&object{ | ||
| * context: \yii\build\controllers\TranslationController, | ||
| * } $this | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| */ | ||
|
|
||
| ?><!doctype html> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -674,14 +674,14 @@ public function resolveCallableDependencies(callable $callback, $params = []) | |
| if ($class instanceof \ReflectionUnionType || (PHP_VERSION_ID >= 80100 && $class instanceof \ReflectionIntersectionType)) { | ||
| $isClass = false; | ||
| foreach ($class->getTypes() as $type) { | ||
| if (!$type->isBuiltin()) { | ||
| if ($type instanceof \ReflectionNamedType && !$type->isBuiltin()) { | ||
| $class = $type; | ||
| $isClass = true; | ||
| break; | ||
| } | ||
| } | ||
| } else { | ||
| $isClass = $class !== null && !$class->isBuiltin(); | ||
| $isClass = $class instanceof \ReflectionNamedType && !$class->isBuiltin(); | ||
|
||
| } | ||
| } else { | ||
| $class = $param->getClass(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ public function validateAttribute($model, $attribute) | |
| if (is_string($method)) { | ||
| $method = [$model, $method]; | ||
| } elseif ($method instanceof \Closure) { | ||
| $method = $this->method->bindTo($model); | ||
| $method = $method->bindTo($model); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| $current = $this->current; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,7 @@ class Controller extends \yii\base\Controller | |
| */ | ||
| public function renderAjax($view, $params = []) | ||
| { | ||
| return $this->getView()->renderAjax($view, $params, $this); | ||
| return $this->view->renderAjax($view, $params, $this); | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
||





There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it works after the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I checked it out.