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

Dev: Remove the Helpers ignore errors in phpstan-baseline.php #7777

Merged
merged 5 commits into from
Aug 4, 2023

Conversation

jinny8813
Copy link
Contributor

@jinny8813 jinny8813 commented Aug 4, 2023

Description
See #7731

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
Contributor

@datamweb datamweb left a 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

* @param array ...$vars
* @param array $vars
*
* @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

Copy link
Member

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

/**
* trace function
*
* @return int
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 int
* @return void

@jinny8813 jinny8813 marked this pull request as draft August 4, 2023 07:30
@jinny8813 jinny8813 marked this pull request as ready for review August 4, 2023 07:38
@jinny8813 jinny8813 requested review from datamweb and kenjis August 4, 2023 07:40
/**
* trace function
*
* @return int|string
Copy link
Member

@kenjis kenjis Aug 4, 2023

Choose a reason for hiding this comment

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

This method returns nothing.

Suggested change
* @return int|string
* @return void

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. Tks for review

@jinny8813 jinny8813 marked this pull request as draft August 4, 2023 07:46
@jinny8813 jinny8813 marked this pull request as ready for review August 4, 2023 07:51
@jinny8813 jinny8813 requested a review from kenjis August 4, 2023 07:51
@jinny8813 jinny8813 marked this pull request as draft August 4, 2023 07:59
@jinny8813 jinny8813 marked this pull request as ready for review August 4, 2023 08:05
@kenjis
Copy link
Member

kenjis commented Aug 4, 2023

Error: Function trace() has no return type specified.
 ------ ------------------------------------------------ 
  Line   system/Helpers/kint_helper.php                  
 ------ ------------------------------------------------ 
  70     Function trace() has no return type specified.  
 ------ ------------------------------------------------ 

https://github.com/codeigniter4/CodeIgniter4/actions/runs/5759908201/job/15614892837?pr=7777

@datamweb
Copy link
Contributor

datamweb commented Aug 4, 2023

@jinny8813 You can run the phpstan analyse before push it on GitHub.

php vendor/bin/phpstan analyse

more information see

@jinny8813
Copy link
Contributor Author

@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!!

Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

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

LGTM!

@kenjis kenjis merged commit 6c22cce into codeigniter4:develop Aug 4, 2023
@kenjis
Copy link
Member

kenjis commented Aug 4, 2023

@jinny8813 Thank you!

@jinny8813 jinny8813 deleted the 0804_phpstan_helpers branch August 28, 2023 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants