Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf30cc7b

Browse files
minor#60096 [DependencyInjection] Add better return type onContainerInterface::get() (lyrixx)
This PR was merged into the 7.3 branch.Discussion----------[DependencyInjection] Add better return type on `ContainerInterface::get()`| Q | A| ------------- | ---| Branch? | 7.3| Bug fix? | no| New feature? | yes| Deprecations? | no| Issues || License | MITSeehttps://phpstan.org/r/a58736e6-f181-4bea-ad14-134f55229664![image](https://github.com/user-attachments/assets/68ab6dfe-89e8-4b2a-afc9-4932ef87d4ff)Commits-------45e67ac [DependencyInjection] Add better return type on ContainerInterface::get()
2 parents904df78 +45e67ac commitf30cc7b

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
publicfunctionset(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 isself::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE? object : object|null)
42+
* @return ($id is class-string<C> ? (B is0|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)

[8]ページ先頭

©2009-2025 Movatter.jp