| 1 | <?php |
||
| 14 | final class ConnectionRegistry |
||
| 15 | { |
||
| 16 | /** @var Client[] */ |
||
| 17 | private $connections; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * ConnectionRegistry constructor. |
||
| 21 | */ |
||
| 22 | 2 | public function __construct() |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $clientIdentifier |
||
| 29 | * |
||
| 30 | * @return Client |
||
| 31 | * |
||
| 32 | * @throws ClientNotFoundException |
||
| 33 | */ |
||
| 34 | 1 | public function getClient(string $clientIdentifier): Client |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $clientIdentifier |
||
| 45 | * @param Client $client |
||
| 46 | * |
||
| 47 | * @throws ExistantClientException |
||
| 48 | */ |
||
| 49 | 2 | public function addClient(string $clientIdentifier, Client $client) |
|
| 57 | |||
| 58 | /** |
||
| 59 | * @param string $clientIdentifier |
||
| 60 | * |
||
| 61 | * @return bool |
||
| 62 | */ |
||
| 63 | 2 | public function hasClient(string $clientIdentifier): bool |
|
| 67 | } |
||
| 68 |