1 | <?php |
||
22 | class ConnectorFactory implements ConnectorFactoryInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $dnsServer; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $dnsEnabled; |
||
33 | |||
34 | /** |
||
35 | * @var bool |
||
36 | */ |
||
37 | private $sslEnabled; |
||
38 | |||
39 | /** |
||
40 | * @var LoopInterface |
||
41 | */ |
||
42 | private $loop; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $sslOptions; |
||
48 | |||
49 | 1 | public function __construct(LoopInterface $loop) |
|
57 | |||
58 | /** |
||
59 | * @return ConnectorFactory |
||
60 | */ |
||
61 | public function enableDns(): ConnectorFactory |
||
67 | |||
68 | /** |
||
69 | * @return ConnectorFactory |
||
70 | */ |
||
71 | public function disableDns(): ConnectorFactory |
||
77 | |||
78 | /** |
||
79 | * @return ConnectorFactory |
||
80 | */ |
||
81 | public function enableSsl(): ConnectorFactory |
||
87 | |||
88 | /** |
||
89 | * @return ConnectorFactory |
||
90 | */ |
||
91 | public function disableSsl(): ConnectorFactory |
||
97 | |||
98 | /** |
||
99 | * @param string $server Ip address of the DNS server you want to contact. |
||
100 | * @return ConnectorFactory |
||
101 | */ |
||
102 | public function setDnsServer(string $server): ConnectorFactory |
||
108 | |||
109 | /** |
||
110 | * This allows the user to use its own loop to potentially use it for something else. |
||
111 | * |
||
112 | * @param LoopInterface $loop |
||
113 | * @return ConnectorFactoryInterface |
||
114 | */ |
||
115 | public function setLoop(LoopInterface $loop): ConnectorFactoryInterface |
||
121 | |||
122 | /** |
||
123 | * @param array $options |
||
124 | * @return ConnectorFactory |
||
125 | */ |
||
126 | public function setSslOptions(array $options): ConnectorFactory |
||
132 | |||
133 | 1 | public function createConnector(): ConnectorInterface |
|
150 | } |
||
151 |