Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
95 | public function import() |
||
96 | { |
||
97 | $file = $this->file . '.json'; |
||
98 | |||
99 | if (file_exists($file)) { |
||
100 | $data = json_decode( |
||
101 | file_get_contents($file), |
||
102 | true |
||
103 | ); |
||
104 | $this->createdAt = new \DateTime($data['createdAt']); |
||
105 | $this->count = $data['count']; |
||
106 | } else { |
||
107 | $this->createdAt = new \DateTime(); |
||
108 | $this->count = 1; |
||
109 | } |
||
110 | } |
||
111 | |||
128 |