8000 [Contracts/Service] Add generics to ServiceProviderInterface · symfony/symfony@2aa459a · GitHub
[go: up one dir, main page]

Skip to content

Commit 2aa459a

Browse files
[Contracts/Service] Add generics to ServiceProviderInterface
1 parent 0e9cfc3 commit 2aa459a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Symfony/Contracts/Service/ServiceProviderInterface.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,23 @@
1818
*
1919
* @author Nicolas Grekas <p@tchwork.com>
2020
* @author Mateus 8000 z Sip <mateusz.sip@gmail.com>
21+
*
22+
* @template T of mixed
2123
*/
2224
interface ServiceProviderInterface extends ContainerInterface
2325
{
26+
/**
27+
* {@inheritdoc}
28+
*
29+
* @return T
30+
*/
31+
public function get(string $id): mixed;
32+
33+
/**
34+
* {@inheritdoc}
35+
*/
36+
public function has(string $id): bool;
37+
2438
/**
2539
* Returns an associative array of service types keyed by the identifiers provided by the current container.
2640
*

0 commit comments

Comments
 (0)
0