Skip to content

PhpdocNoSuperfluousParamFixer error on array{} param #1064

@MarcHagen

Description

@MarcHagen

This docblock is a valid object, as it defines an array.
Its therefor not superfluous (aka it provides useful information)

    /**
     * @param array{
     *     message: string,
     *     context: array<string, object|array|scalar|null>,
     *     level: int,
     *     level_name: string,
     *     channel: string,
     *     datetime: DateTimeImmutable,
     *     extra: mixed[]
     * } $formattedRecord
     */
    public function prepareRecord(array $formattedRecord): array {}

It seems your code it not handling the NULL correctly from the getVariableName()

$paramName = $annotation->getVariableName();

But maybe PHP-CS-Fixer NoSuperfluousPhpdocTagsFixer is generally better maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions