Skip to content

Commit dd1db43

Browse files
mathrocnicolas-grekas
authored andcommitted
Improve type annotation of ContainerInterface::get()
1 parent 2a5bc2f commit dd1db43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ContainerInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ interface ContainerInterface extends PsrContainerInterface
3636
public function set(string $id, ?object $service);
3737

3838
/**
39+
* @template B of self::*_REFERENCE
40+
*
41+
* @param B $invalidBehavior
42+
*
43+
* @psalm-return (B is self::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE ? object : object|null)
44+
*
3945
* @throws ServiceCircularReferenceException When a circular reference is detected
4046
* @throws ServiceNotFoundException When the service is not defined
4147
*

0 commit comments

Comments
 (0)