Conditions | 3 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
13 | 16 | public function decrypt($dlc) |
|
14 | { |
||
15 | 16 | $this->log('Started file decrypting', Logger::INFO); |
|
16 | |||
17 | 16 | if (@file_exists(realpath($dlc))) { |
|
18 | 7 | $dlc = realpath($dlc); |
|
19 | 7 | $fs = new Local(dirname($dlc)); |
|
20 | 7 | $content = $fs->read($fs->removePathPrefix($dlc))['contents']; |
|
21 | } else { |
||
22 | 9 | $content = $dlc; |
|
23 | } |
||
24 | |||
25 | 16 | if (!$content) { |
|
26 | 3 | throw new \RuntimeException('Empty content.'); |
|
27 | } |
||
28 | |||
29 | 13 | $links = $this->getLinks($content); |
|
30 | |||
31 | 7 | $this->log('Finished file decrypting', Logger::INFO); |
|
32 | |||
33 | 7 | return $links; |
|
34 | } |
||
35 | |||
38 |