1 | <?php |
||
28 | class ServerFactory { |
||
29 | const BACKENDS = [ |
||
30 | NativeServer::class, |
||
31 | Server::class |
||
32 | ]; |
||
33 | |||
34 | /** @var System */ |
||
35 | private $system; |
||
36 | |||
37 | /** @var IOptions */ |
||
38 | private $options; |
||
39 | |||
40 | /** @var ITimeZoneProvider */ |
||
41 | private $timeZoneProvider; |
||
42 | |||
43 | /** |
||
44 | * ServerFactory constructor. |
||
45 | * |
||
46 | * @param IOptions|null $options |
||
47 | * @param ISystem|null $system |
||
48 | * @param ITimeZoneProvider|null $timeZoneProvider |
||
49 | */ |
||
50 | 8 | public function __construct( |
|
51 | IOptions $options = null, |
||
52 | ISystem $system = null, |
||
53 | ITimeZoneProvider $timeZoneProvider = null |
||
54 | ) { |
||
55 | 8 | if (is_null($options)) { |
|
56 | 8 | $options = new Options(); |
|
57 | } |
||
58 | 8 | if (is_null($system)) { |
|
59 | $system = new System(); |
||
60 | } |
||
61 | 8 | if (is_null($timeZoneProvider)) { |
|
62 | 8 | $timeZoneProvider = new TimeZoneProvider($system); |
|
63 | } |
||
64 | 8 | $this->options = $options; |
|
65 | 8 | $this->system = $system; |
|
66 | 8 | $this->timeZoneProvider = $timeZoneProvider; |
|
67 | 8 | } |
|
68 | |||
69 | |||
70 | /** |
||
71 | * @param $host |
||
72 | * @param IAuth $credentials |
||
73 | * @return IServer |
||
74 | * @throws DependencyException |
||
75 | */ |
||
76 | 8 | public function createServer($host, IAuth $credentials) { |
|
85 | } |
||
86 |