Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
35 | 44 | public static function store($filename, $data) |
|
36 | { |
||
37 | 44 | $path = self::getPath(); |
|
38 | 44 | if (strpos($filename, $path) === 0) { |
|
39 | 44 | $filename = substr($filename, strlen($path)); |
|
40 | } |
||
41 | try { |
||
42 | 44 | self::_store($filename, Json::encode($data)); |
|
43 | 43 | return true; |
|
44 | 2 | } catch (Exception $e) { |
|
45 | 2 | return false; |
|
46 | } |
||
47 | } |
||
48 | } |
||
49 |