Skip to content
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: wrong Config classname to config() in Toolbar #7735

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Changes from all 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 system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
return;
}

$toolbar = Services::toolbar(config(self::class));
Copy link
Member Author

@kenjis kenjis Jul 25, 2023

Choose a reason for hiding this comment

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

self::class is CodeIgniter\Debug\Toolbar, and the basename is Toolbar.
So Factories will load Config\Toolbar (preferApp) now.

Copy link
Member Author

@kenjis kenjis Jul 25, 2023

Choose a reason for hiding this comment

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

But with #7733, Factories will try to instantiate CodeIgniter\Debug\Toolbar,
and it causes:

ArgumentCountError
Too few arguments to function CodeIgniter\Debug\Toolbar::__construct(), 0 passed in 
/.../CodeIgniter4/system/Config/Factories.php on line 183 and exactly 1 expected

But I was not able to get the error message and error log if I did not enable step debugging with Xdebug.
Why spark serve died without log?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure; that's an odd one. Maybe some kind of autoloading loop?

$toolbar = Services::toolbar(config(ToolbarConfig::class));
$stats = $app->getPerformanceStats();
$data = $toolbar->run(
$stats['startTime'],
Expand Down