Skip to content

Commit

Permalink
Merge pull request #154 from InvisibleSmiley/bugfix/153
Browse files Browse the repository at this point in the history
Allow PHPStan to understand conditional returns
  • Loading branch information
Ocramius authored Sep 22, 2022
2 parents 6acba46 + 7d5e91a commit 360be5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AbstractPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function setService($name, $service)
* @param class-string<InstanceType>|string $name Service name of plugin to retrieve.
* @param null|array<mixed> $options Options to use when creating the instance.
* @return mixed
* @psalm-return ($name is class-string ? InstanceType : mixed)
* @psalm-return ($name is class-string<InstanceType> ? InstanceType : mixed)
* @throws Exception\ServiceNotFoundException If the manager does not have
* a service definition for the instance, and the service is not
* auto-invokable.
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceLocatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ServiceLocatorInterface extends ContainerInterface
* @param string|class-string<T> $name
* @param null|array<mixed> $options
* @return mixed
* @psalm-return ($name is class-string ? T : mixed)
* @psalm-return ($name is class-string<T> ? T : mixed)
* @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 360be5f

Please sign in to comment.