You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Psalm is now able to properly understand something like:
object&callable(array):array
This would reduce errors with post processors being instantiated before being passed to the ConfigAggregator::__construct.
Example:
$parameterPostProcessor = new \Laminas\ConfigAggregatorParameters\LazyParameterPostProcessor(fn () => []);
$aggregator = new \Laminas\ConfigAggregator\ConfigAggregator([], null, [$parameterPostProcessor]);
This leads to an error:
InvalidArgument - config/config.php:45:50 - Argument 3 of Laminas\ConfigAggregator\ConfigAggregator::__construct expects list<callable(array<array-key, mixed>)|class-string>, but list{Laminas\ConfigAggregatorParameters\LazyParameterPostProcessor<array<string, mixed>>} provided (see https://psalm.dev/004)
To fix this, adding object&PostProcessorCallable and object&PreProcessorCallable to the annotation should fix the problem.
Something like this was also introduced in laminas-servicemanager with v4.0 and is supported by both psalm and phpstan.
The text was updated successfully, but these errors were encountered:
Feature Request
Summary
Psalm is now able to properly understand something like:
object&callable(array):array
This would reduce errors with post processors being instantiated before being passed to the
ConfigAggregator::__construct
.Example:
This leads to an error:
To fix this, adding
object&PostProcessorCallable
andobject&PreProcessorCallable
to the annotation should fix the problem.Something like this was also introduced in
laminas-servicemanager
with v4.0 and is supported by both psalm and phpstan.The text was updated successfully, but these errors were encountered: