Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0176 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
90 | 24 | public function delete() |
|
91 | { |
||
92 | 24 | if ($this->isDeleted) { |
|
93 | 3 | return; |
|
94 | } |
||
95 | |||
96 | 24 | if (!unlink($this->path)) { |
|
97 | throw new \ErrorException(sprintf('File with path "%s" could not be deleted.', $this->path)); |
||
98 | } |
||
99 | |||
100 | 24 | unset($this->path); |
|
101 | 24 | $this->isDeleted = true; |
|
102 | } |
||
103 | } |