Skip to content

Commit a4a823e

Browse files
[Contracts/Service] Add generics to ServiceProviderInterface
1 parent 39ee25e commit a4a823e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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 <[email protected]>
2020
* @author Mateusz Sip <[email protected]>
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)