Total Complexity | 7 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 81.82% |
Changes | 0 |
1 | <?php |
||
18 | final class Greeting |
||
19 | { |
||
20 | public const SIZE_BYTES = 128; |
||
21 | |||
22 | private $greeting; |
||
23 | private $salt; |
||
24 | |||
25 | private function __construct() |
||
26 | 260 | { |
|
27 | unset($this->salt); |
||
28 | 260 | } |
|
29 | 42 | ||
30 | public static function parse(string $greeting) : self |
||
31 | { |
||
32 | 218 | if (0 !== \strpos($greeting, 'Tarantool')) { |
|
33 | 8 | throw InvalidGreeting::invalidServerName(); |
|
34 | } |
||
35 | |||
36 | 210 | $self = new self(); |
|
37 | $self->greeting = $greeting; |
||
38 | 210 | ||
39 | 198 | return $self; |
|
40 | } |
||
41 | |||
42 | 12 | public function getSalt() : string |
|
45 | } |
||
46 | |||
47 | public function __get($name) : string |
||
60 | } |
||
61 | } |
||
62 |