| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | 10 | public function __invoke( $selector, $token, $valid_until ) |
|
| 54 | { |
||
| 55 | // Encrypt first |
||
| 56 | 10 | $encryptor = $this->encryptor; |
|
| 57 | 10 | $crypted = $encryptor( $selector, $token); |
|
| 58 | |||
| 59 | // Set cookie |
||
| 60 | 10 | $cookie_setter = $this->cookie_setter; |
|
| 61 | 10 | $storage_result = $cookie_setter( |
|
| 62 | 10 | $this->cookie_name, |
|
| 63 | 8 | $crypted, |
|
| 64 | 6 | $valid_until |
|
| 65 | 2 | ); |
|
| 66 | |||
| 67 | 10 | if (!$storage_result) { |
|
| 68 | 5 | throw new StorageException("Could not store persistent login cookie on client: " . $this->cookie_name . " " . $valid_until); |
|
| 69 | } |
||
| 70 | 5 | return $storage_result; |
|
| 71 | } |
||
| 72 | } |
||
| 73 |