| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | 99 | public function unserialize($serialized) |
|
| 57 | { |
||
| 58 | 99 | $data = json_decode($serialized, true); |
|
| 59 | |||
| 60 | 99 | if (empty($data)) { |
|
| 61 | 72 | $this->clear(); |
|
| 62 | 56 | } else { |
|
| 63 | 45 | $cookieFactory = $this->getCookieFactory(); |
|
| 64 | |||
| 65 | 45 | $this->setCookies(array_map(function (array $cookie) use ($cookieFactory) { |
|
| 66 | 45 | return $cookieFactory->create( |
|
| 67 | 45 | $cookie['name'], |
|
| 68 | 45 | $cookie['value'], |
|
| 69 | 45 | $cookie['attributes'], |
|
| 70 | 45 | $cookie['created_at'] |
|
| 71 | 35 | ); |
|
| 72 | 45 | }, $data)); |
|
| 73 | } |
||
| 74 | 99 | } |
|
| 75 | } |
||
| 76 |