-
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
Dev: Remove the Helpers ignore errors in phpstan-baseline.php #7777
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.
https://github.com/codeigniter4/CodeIgniter4/actions/runs/5758096420/job/15610910416?pr=7777
Error: Function trace() should return int but return statement is missing.
------ ---------------------------------------------------------------------
Line system/Helpers/kint_helper.php
------ ---------------------------------------------------------------------
78 Function trace() should return int but return statement is missing.
------ ---------------------------------------------------------------------
see
https://github.com/kint-php/kint/blob/a700653a77250b122920799b10c94e904c9b78c7/src/Kint.php#L472
system/Helpers/kint_helper.php
Outdated
* @param array ...$vars | ||
* @param array $vars | ||
* | ||
* @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 |
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.
Please apply my suggested change.
The true return type is not void
, but never
.
See https://phpstan.org/writing-php-code/phpdoc-types#bottom-type
https://www.php.net/manual/en/language.types.never.php
system/Helpers/kint_helper.php
Outdated
/** | ||
* trace function | ||
* | ||
* @return int |
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 int | |
* @return void |
system/Helpers/kint_helper.php
Outdated
/** | ||
* trace function | ||
* | ||
* @return int|string |
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 method returns nothing.
* @return int|string | |
* @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.
OK. Tks for review
https://github.com/codeigniter4/CodeIgniter4/actions/runs/5759908201/job/15614892837?pr=7777 |
@jinny8813 You can run the phpstan analyse before push it on GitHub. php vendor/bin/phpstan analyse more information see |
tks for helping me!! it return no error in ./system/Helpers!! |
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.
LGTM!
@jinny8813 Thank you! |
Description
See #7731
Checklist: