Skip to content

Magento2.Annotation.MethodArguments.MethodArguments can't deal with phpstan-style array argument types #276

Open
@hostep

Description

@hostep

Preconditions

This started happening after upgrading the coding-standard library from version 6 to version 10 on a custom module of mine.

I suspect that this library currently can't deal wit phpstan-style array argument types (and psalm has the same concept btw)

Steps to reproduce

  1. Have a class like this:
<?php

declare(strict_types=1);

namespace Whatever;

use Symfony\Component\Console\Output\OutputInterface;

class SomeClass
{
    /**
     * @param array<array<string, mixed>> $categoryData
     */
    public function outputResult(array $categoryData, OutputInterface $output): int
    {
        return 0;
    }
}
  1. Run this library over it

Expected result

  1. No warnings

Actual result

  1. Warnings:
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 14 | WARNING | @param is not found for one or more params in method annotation
    |         | (Magento2.Annotation.MethodArguments.MethodArguments)
 14 | WARNING | $categoryData parameter is missing in method annotation (Magento2.Annotation.MethodArguments.MethodArguments)
--------------------------------------------------------------------------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions