-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerInterface.php
More file actions
41 lines (36 loc) · 996 Bytes
/
ContainerInterface.php
File metadata and controls
41 lines (36 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
declare(strict_types=1);
namespace Dhii\Collection;
use Psr\Container\ContainerInterface as BaseContainerInterface;
/**
* Something that can retrieve and determine the existence of a value by key.
*
* @template K of string
* @template-covariant V of mixed
* @template-extends HasCapableInterface<K>
*/
interface ContainerInterface extends
HasCapableInterface,
BaseContainerInterface
{
/**
* Finds an entry of the container by its identifier and returns it.
*
* @param K $id Identifier of the entry to look for.
*
* @return V Entry.
*
* @psalm-suppress MoreSpecificImplementedParamType The point is to narrow it.
*/
#[\Override]
public function get(string $id): mixed;
/**
* @inheritDoc
*
* @param K $id Identifier of the entry to look for.
*
* @psalm-suppress MoreSpecificImplementedParamType The point is to narrow it.
*/
#[\Override]
public function has(string $id): bool;
}