Skip to content

Commit

Permalink
Adapt PluginManagerInterface generics to match SLI
Browse files Browse the repository at this point in the history
Allow PHPStan to understand conditional returns

Signed-off-by: Jens Hatlak <[email protected]>
  • Loading branch information
jhatlak committed Mar 22, 2024
1 parent a6149b9 commit c936ac7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PluginManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function validate(mixed $instance): void;
/**
* @template TRequestedInstance extends InstanceType
* @psalm-param class-string<TRequestedInstance>|string $id Service name of plugin to retrieve.
* @psalm-return ($id is class-string ? TRequestedInstance : InstanceType)
* @psalm-return ($id is class-string<TRequestedInstance> ? TRequestedInstance : InstanceType)
* @throws Exception\ServiceNotFoundException If the manager does not have
* a service definition for the instance, and the service is not
* auto-invokable.
Expand All @@ -43,7 +43,7 @@ public function get(string $id): mixed;
*
* @template TRequestedInstance extends InstanceType
* @psalm-param string|class-string<TRequestedInstance> $name
* @psalm-return ($name is class-string ? TRequestedInstance : InstanceType)
* @psalm-return ($name is class-string<TRequestedInstance> ? TRequestedInstance : InstanceType)
* @throws Exception\ServiceNotFoundException If no factory/abstract
* factory could be found to create the instance.
* @throws Exception\ServiceNotCreatedException If factory/delegator fails
Expand Down

0 comments on commit c936ac7

Please sign in to comment.