Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
47 | 30 | public function __get($name) : string |
|
48 | { |
||
49 | 30 | if (false === $salt = \base64_decode(\substr($this->greeting, 64, 44), true)) { |
|
50 | 8 | throw InvalidGreeting::invalidSalt(); |
|
51 | } |
||
52 | |||
53 | 22 | $salt = \substr($salt, 0, 20); |
|
54 | |||
55 | 22 | if (isset($salt[19])) { |
|
56 | 10 | return $this->salt = $salt; |
|
57 | } |
||
58 | |||
59 | 12 | throw InvalidGreeting::invalidSalt(); |
|
60 | } |
||
62 |