Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mvhirsch opened this issue Nov 18, 2023 · 0 comments
Open

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

mvhirsch opened this issue Nov 18, 2023 · 0 comments
Assignees

Comments

@mvhirsch
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants