Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/controllers/ReleaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ protected function releaseFramework($frameworkPath, $version)
$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"]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

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?

Copy link
Contributor Author

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.

image image

$this->stdout("done.\n", Console::FG_GREEN, Console::BOLD);

$this->stdout("fixing various PHPDoc style issues...\n", Console::BOLD);
Expand Down
4 changes: 4 additions & 0 deletions build/controllers/views/translation/report_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

*/

?><!doctype html>
Expand Down
4 changes: 2 additions & 2 deletions framework/di/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

This code is executed for PHP8.0 and above, so isBuiltin is only available in ReflectionNamedType. Nothing should break

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you achieve the same with some annotations instead? Adding more checks, which aren't useful, to DI container costs performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
} else {
$class = $param->getClass();
Expand Down
2 changes: 2 additions & 0 deletions framework/requirements/YiiRequirementChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ function renderViewFile($_viewFile_, $_data_ = null, $_return_ = false)
} else {
require $_viewFile_;
}

return null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion framework/validators/InlineValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

}

$current = $this->current;
Expand Down
2 changes: 1 addition & 1 deletion framework/web/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

As far as I know, $this->view is completely identical to $this->getView(), so nothing should break

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? 1. There's initialization happens. 2. One may extend and override the method.

Copy link
Contributor Author

@mspirkov mspirkov Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I fixed it using annotations

}

/**
Expand Down
Loading