-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: Remove the Debug
ignore errors.
#7796
Conversation
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.
Thanks again! Some more comments on this one.
system/Log/Logger.php
Outdated
*/ | ||
public $logCache; | ||
public array $logCache; |
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.
This is a breaking change for class extensions. Please explain or revert.
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.
Hi @MGatner , thanks for your reply.
I have now restored this attribute to its original state.
The reason I will make this change is because of the following.
$ignoreErrors[] = [ 'message' => '#^Property CodeIgniter\\\\Log\\\\Logger\\:\\:\\$logCache \\(array\\) on left side of \\?\\? is not nullable\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Logs.php', ];
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.
That is not a "type specified" error. We can tackle that in separate PR.
system/Debug/Timer.php
Outdated
* @param string $name The name of the timer | ||
* @param callable $callable callable to be executed | ||
* @param string $name The name of the timer | ||
* @phpstan-param callable():mixed $callable callable to be executed |
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.
* @phpstan-param callable():mixed $callable callable to be executed | |
* @phpstan-param callable(): mixed $callable callable to be executed |
system/Debug/Toolbar.php
Outdated
@@ -434,6 +436,8 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r | |||
* Inject debug toolbar into the response. | |||
* | |||
* @codeCoverageIgnore | |||
* | |||
* @return void |
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.
* @return void | |
* @return void | |
* @phpstan-return never|void |
system/Debug/Exceptions.php
Outdated
@@ -112,6 +114,8 @@ public function initialize() | |||
* and fire an event that allows custom actions to be taken at this point. | |||
* | |||
* @codeCoverageIgnore | |||
* | |||
* @return void |
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.
* @return void | |
* @return void | |
* @phpstan-return never|void |
system/Debug/Exceptions.php
Outdated
@@ -189,6 +193,8 @@ public function errorHandler(int $severity, string $message, ?string $file = nul | |||
* need to be caught and handle them. | |||
* | |||
* @codeCoverageIgnore | |||
* | |||
* @return void |
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.
* @return void | |
* @return void | |
* @phpstan-return never|void |
system/Debug/Exceptions.php
Outdated
@@ -243,6 +249,8 @@ protected function determineView(Throwable $exception, string $templatePath): st | |||
|
|||
/** | |||
* Given an exception and status code will display the error to the client. | |||
* | |||
* @return void |
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.
* @return void | |
* @return void | |
* @phpstan-return never|void |
2122069
to
6dfc38b
Compare
Description
See #7731
The remaining two sections of the Debug have not been corrected.
The viewer attribute refers to the RendererInterface, but the RendererInterface has undefined method of
getPerformanceData()
andgetData()
methods.Maybe replace the viewer attribute reference with
CodeIgniter\View\View
?After issuing this PR, I tried to change the reference attribute and phpstan does not show Debug section related errors.
I will update the commit to this PR if needed.
before the change viewer attribute refers
phpstan-baseline.php
:system/Debug/Toolbar/Collectors/Views.php
:after the change viewer attribute refers
phpstan-baseline.php
:system/Debug/Toolbar/Collectors/Views.php
:Checklist: