Skip to content

Commit 45e67ac

Browse files
committed
[DependencyInjection] Add better return type on ContainerInterface::get()
1 parent 904df78 commit 45e67ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Component/DependencyInjection/ContainerInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ interface ContainerInterface extends PsrContainerInterface
3333
public function set(string $id, ?object $service): void;
3434

3535
/**
36+
* @template C of object
3637
* @template B of self::*_REFERENCE
3738
*
38-
* @param B $invalidBehavior
39+
* @param string|class-string<C> $id
40+
* @param B $invalidBehavior
3941
*
40-
* @psalm-return (B is self::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE ? object : object|null)
42+
* @return ($id is class-string<C> ? (B is 0|1 ? C|object : C|object|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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy