-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Expected type hint int[]; found array in Squiz FunctionCommentSniff #601
Comments
Because it expects |
Maybe we need to make error message more intelligent. |
Yeah, I think |
It is, but Squiz standard specifically requires long type names. |
I see. But I guess there is a separate error for that? I think it should take Also, this actually isn't limited to short types. The same error would be given for |
Then this is surely a bug. |
The same for /**
* Does foo with MyClass objects.
*
* @param MyClass[] $list List of objects.
*/
function foo( array $list ) {} gives
|
That is another non-related bug with forcing user to use typehint, that will end up with syntax error in PHP. Please report it separately. |
Example code:
Expected result:
This should be OK.
Actual result:
The error comes from https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php#L386.
The text was updated successfully, but these errors were encountered: