Total Complexity | 7 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class Response |
||
10 | { |
||
11 | public const INVALID = 'invalid'; |
||
12 | public const DONE = 'done'; |
||
13 | |||
14 | /** @var string */ |
||
15 | private $profile; |
||
16 | |||
17 | /** @var string */ |
||
18 | private $versionNumber; |
||
19 | |||
20 | /** @var string */ |
||
21 | private $status; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $body; |
||
25 | |||
26 | private function __construct(string $profile, string $versionNumber, string $status, string $body) |
||
32 | } |
||
33 | |||
34 | public static function createInvalidResponse(Query $query): self |
||
35 | { |
||
36 | return new self( |
||
37 | $query->getProfile()->getName()->getValue(), |
||
38 | $query->getProfile()->getVersion()->getValue(), |
||
39 | self::INVALID, |
||
40 | '' |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | public static function createValidResponse(Unit $unit): self |
||
52 | ); |
||
53 | } |
||
54 | |||
55 | public function getProfileName(): string |
||
58 | } |
||
59 | |||
60 | public function getVersionNumber(): string |
||
61 | { |
||
62 | return $this->versionNumber; |
||
63 | } |
||
64 | |||
65 | public function getStatus(): string |
||
66 | { |
||
67 | return $this->status; |
||
68 | } |
||
69 | |||
70 | public function getBody(): string |
||
73 | } |
||
74 | } |
||
75 |