Skip to content

FilesystemMap should specify \IteratorAggregate<TKey, TValue> #281

Open
@mvhirsch

Description

@mvhirsch

After injecting FilesystemMap into one of my services, PHPStan reports an error:

final class MyClass
{
    public function __construct(FilesystemMap $filesystemMap) 
    {
         // ...
    }
   
    // ...
}
Method MyClass::__construct() has parameter $filesystemMap with no value type specified in iterable type Knp\Bundle\GaufretteBundle\FilesystemMap.

A quick look at FilesystemMap revealed: it's implementing \IteratorAggregate but do not specify it's values.

I do think this is enough, but currently unable to test it:

/**
 * @implements \IteratorAggregate<string, FilesystemMap>
 */
class FilesystemMap implements \IteratorAggregate, FilesystemMapInterface

Metadata

Metadata

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