laminas-servicemanager icon indicating copy to clipboard operation
laminas-servicemanager copied to clipboard

Psalm type `ServiceManagerConfiguration` of `ServiceManager` is invalid

Open boesing opened this issue 2 years ago • 1 comments

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.

boesing avatar Sep 21 '21 15:09 boesing

Ref: https://github.com/vimeo/psalm/issues/2105

Ocramius avatar Sep 21 '21 15:09 Ocramius