Skip to content

array type hints for something[] notation #1035

@firegate666

Description

@firegate666

We use the possibility to document real types instead of generic array (as java does) but the code sniffers complains about this

/*
* @param array $array
* @param string[] $string_array
* @param myObject[] $object_array
*/
function(array $array, array $string_array, array $object_array) {

with the following error

503 | ERROR | [ ] Expected type hint "myObject[]"; found "array"
     |       |     for $object_array
     |       |     (Grepolis.Commenting.FunctionComment.IncorrectTypeHint)
686 | ERROR | [ ] Expected type hint "string[]"; found "array" for
     |       |     $string_array

Any change we can get that in? If the doc hint ends with [], it is considered an array?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions