Closed BowFarmer closed 1 year ago
@BowFarmer This report contains too little information to reproduce the issue.
I suspect the error is the Squiz.Commenting.FunctionComment.IncorrectTypeHint
error, but that sniff only kicks in when there is a docblock and the code sample provided does not contain a docblock, making the issue impossible to reproduce.
You can see the sniff code associated with the error message by running phpcs -s test.php --standard=WordPress
If the above sniff is the issue, I suggest you fix up your docblock.
If not, please report back with enough information to reproduce the issue if the error code starts with Generic
, MySource
, PEAR
, PSR1
, PSR2
, PSR12
, Squiz
or Zend
.
If the error code starts with something else, please report it to whatever external standard the error is coming from.
Hi Juliette,
Thank you for your quick reply. This is what I get when I run phpcs -s --standard=WordPress on the file.
Expected type hint "Datetime"; found "DateTime" for $day_to_check (Squiz.Commenting.FunctionComment.IncorrectTypeHint)
@BowFarmer Thanks for confirming, but that means the issue is still not reproducible with the code sample given.
As I suggested before: I believe the typo is in your docblock (the case of the type hint for that same parameter in the @param
tag). The error should go away when you fix the docblock.
Closing for lack of response. If this is still an issue, please provide the additional information requested and if the issue can then be reproduced, the ticket can be reopened.
Describe the bug I received this warning from running phpcs --standard=WordPress on a file. Expected type hint "Datetime"; found "DateTime" for $day_to_check
Code sample
Custom ruleset [Not sure where the problem ruleset is. I'm using the WordPress Coding Standards]
To reproduce Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior I expect that the hint ( DateTime $day_to_check ) has to be DateTime and not Datetime.
Versions (please complete the following information):
Additional context Add any other context about the problem here.