Skip to content

Conversation

@kai890707
Copy link
Contributor

@kai890707 kai890707 commented Aug 8, 2023

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() and getData() 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 :

image

  • system/Debug/Toolbar/Collectors/Views.php :

image
image

after the change viewer attribute refers

  • phpstan-baseline.php :
    image

  • system/Debug/Toolbar/Collectors/Views.php :
    image

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide
Copy link
Member

@MGatner MGatner left a 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.

* @var array
*/
public $logCache;
public array $logCache;
Copy link
Member

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.

Copy link
Contributor Author

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', ];

Copy link
Member

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.

* @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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @phpstan-param callable():mixed $callable callable to be executed
* @phpstan-param callable(): mixed $callable callable to be executed
*
* @codeCoverageIgnore
*
* @return void
Copy link
Member

@kenjis kenjis Aug 9, 2023

Choose a reason for hiding this comment

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

Suggested change
* @return void
* @return void
* @phpstan-return never|void
*
* @codeCoverageIgnore
*
* @return void
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return void
* @return void
* @phpstan-return never|void
*
* @codeCoverageIgnore
*
* @return void
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return void
* @return void
* @phpstan-return never|void
/**
* Given an exception and status code will display the error to the client.
*
* @return void
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return void
* @return void
* @phpstan-return never|void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants