| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 5 | public function unpack(string $content): Data |
|
| 18 | { |
||
| 19 | 5 | $data = @unserialize($content, [ |
|
| 20 | 5 | 'allowed_classes' => [Data::class], |
|
| 21 | 'max_depth' => 2, |
||
| 22 | ]); |
||
| 23 | 5 | if (false === $data) { |
|
| 24 | 1 | throw new UploadException($this->getUppLang()->uppIncomingDataCannotDecode()); |
|
| 25 | } |
||
| 26 | 4 | if (!$data instanceof Data) { |
|
| 27 | 1 | throw new UploadException($this->getUppLang()->uppIncomingDataCannotDecode()); |
|
| 28 | } |
||
| 29 | 3 | return $data->clear(); |
|
| 30 | } |
||
| 37 |