laminas-servicemanager
laminas-servicemanager copied to clipboard
Psalm type `ServiceManagerConfiguration` of `ServiceManager` is invalid
Bug Report
Q | A |
---|---|
Version(s) | 3.10.0 |
Summary
Psalm does not understand intersection types in this combination:
array{foo:string}&AnotherImportedArrayType
https://psalm.dev/r/272229cbfa
Maybe thats a fixable bug within psalm but I think we should also raise raise the issue here.
Current behavior
WhateverManager::__construct expects array{shared_by_default?: bool}, parent type array<string, mixed> provided
How to reproduce
class WhateverManager extends AbstractPluginManager
{}
new WhateverManager(new ServiceManager(), ['foo' => 'bar']);
Expected behavior
No psalm error when analyzing code above.
Ref: https://github.com/vimeo/psalm/issues/2105