8000 [DependencyInjection] Add better return type on ContainerInterface::g… · symfony/symfony@a9110ad · GitHub
[go: up one dir, main page]

Skip to content

Commit a9110ad

Browse files
committed
[DependencyInjection] Add better return type on ContainerInterface::get()
1 parent ab46732 commit a9110ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/DependencyInjection/ContainerInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public function set(string $id, ?object $service): void;
3737
*
3838
* @param B $invalidBehavior
3939
*
40-
* @psalm-return (B is self::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE ? object : object|null)
40+
* @psalm-return ($id is class-string<A> ? (B is self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE|self::EXCEPTION_ON_INVALID_REFERENCE ? A : A|null) : (B is self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE|self::EXCEPTION_ON_INVALID_REFERENCE ? object : object|null))
41+
*
42+
* @return ($id is class-string<A> ? (B is 0|1 ? A : A|null) : (B is 0|1 ? object : object|null))
4143
*
4244
* @throws ServiceCircularReferenceException When a circular reference is detected
4345
* @throws ServiceNotFoundException When the service is not defined

0 commit comments

Comments
 (0)
0