-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
phpcs error on rule classes - must be of the type integer #20186
Comments
Hi @ipascual. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @ipascual do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento-engcom-team give me 2.3 instance |
Hi @orlangur. Thank you for working on this issue.
|
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
Hi @ipascual thank you for you report, you need to use following |
I have the exact same issue. I'm already using the |
using Version 2.3.1 I have the same with all anotation sniffs. every rule i excluded via * for now. |
✅ Confirmed by @engcom-backlog-nazar Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
@magento-engcom-team Unfortunately #22081 does in no way fix the real issue in the Sniff, but pushes the problem a few lines down in the code. The issue is that the Earlier the issue was because this Now the Sniff returns a new error as it's trying to get the closing comment from the token list:
Steps to reproduce the error:
<?php
class Foo{}
Expected result:Normal PHP_CodeSniffer warnings about missing docblocks etc. Actual result:The above mentioned error. Suggested fixChange the Sniff so that if the pointer returned from |
Hi @mattijv i'm have following result -> can you explain ? |
@Nazar65 My bad, seems like there is another edge case that the code hits first with my example. The reason again is most likely the same (i.e. If you add an empty line between <?php
class Foo{} |
@mattijv yeap, thx, i will work on it. |
Hi @Nazar65. Thank you for working on this issue.
|
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Solution
For some reason, the functions are using Variable Typing for integers, however some scenarios is sending boolean. I fixed my local removing the variable typing of any "int" in method signature.
The text was updated successfully, but these errors were encountered: