Debian Codegraph @

vendor/clue/connection-manager-extra/src/ConnectionManagerSwappable.php

raw
1 <?php
2
3 namespace ConnectionManager\Extra;
4
5 use React\Socket\ConnectorInterface;
6
7 // connection manager decorator which simplifies exchanging the actual connection manager during runtime
8 class ConnectionManagerSwappable implements ConnectorInterface
9 {
10 protected $connectionManager;
11
12 public function __construct(ConnectorInterface $connectionManager)
13 {
14 $this->connectionManager = $connectionManager;
15 }
16
17 public function connect($uri)
18 {
19 return $this->connectionManager->connect($uri);
20 }
21
22 public function setConnectionManager(ConnectorInterface $connectionManager)
23 {
24 $this->connectionManager = $connectionManager;
25 }
26 }