Skip to content

InlineCommentSniff not correctly recognising type hints that should be allowed #199

@timhunt

Description

@timhunt

Both of these should be allowed (at least judging by the comment at https://github.com/moodlehq/moodle-cs/blob/main/moodle/Sniffs/Commenting/InlineCommentSniff.php#L191-L194) but I am currently getting them reported as errors in my code:

        /** @var assign $assign */
        [$assign] = $this->create_assignment(...);
        /** @var assign $assign */
        foreach ($assignments as $name => $assign) {

I think the first is explained by the switch from list(...) to [...]. The rule probably needs to be updated. Not sure why the second one is not working.

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