| Conditions | 5 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5.0144 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 49 | 2 | public function setPath($pValue = '', $pVerifyFile = true) |
|
| 50 | { |
||
| 51 | 2 | if ($pVerifyFile) { |
|
| 52 | 2 | if (file_exists($pValue)) { |
|
| 53 | 2 | $this->path = $pValue; |
|
| 54 | |||
| 55 | 2 | if ($this->width == 0 && $this->height == 0) { |
|
| 56 | // Get width/height |
||
| 57 | 2 | list($this->width, $this->height) = getimagesize($pValue); |
|
| 58 | 2 | } |
|
| 59 | 2 | } else { |
|
| 60 | throw new \Exception("File $pValue not found!"); |
||
| 61 | } |
||
| 62 | 2 | } else { |
|
| 63 | 1 | $this->path = $pValue; |
|
| 64 | } |
||
| 65 | |||
| 66 | 2 | return $this; |
|
| 67 | } |
||
| 68 | |||
| 101 |