Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | final class ReverseProxyNewVirtualHostPayload implements JsonPayloadInterface |
||
10 | { |
||
11 | /** @var string */ |
||
12 | private $baseVirtualHost; |
||
13 | |||
14 | /** @var Service */ |
||
15 | private $service; |
||
16 | |||
17 | /** |
||
18 | * ReverseProxyNewVirtualHostPayload constructor. |
||
19 | * @param string $baseVirtualHost |
||
20 | * @param Service $service |
||
21 | */ |
||
22 | public function __construct(string $baseVirtualHost, Service $service) |
||
23 | { |
||
24 | $this->baseVirtualHost = $baseVirtualHost; |
||
25 | $this->service = $service; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @return mixed[] |
||
30 | * @throws ServiceException |
||
31 | */ |
||
32 | public function toArray(): array |
||
37 | ]; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param mixed[] $assoc |
||
42 | * @return self |
||
43 | * @throws ServiceException |
||
44 | */ |
||
45 | public static function fromArray(array $assoc): self |
||
46 | { |
||
47 | return new self($assoc['BASE_VIRTUAL_HOST'], Service::parsePayload($assoc['SERVICE'])); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getBaseVirtualHost(): string |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return Service |
||
60 | */ |
||
61 | public function getService(): Service |
||
64 | } |
||
65 | } |
||
66 |