| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.9256 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | 26 | public function get($value) |
|
| 38 | { |
||
| 39 | 26 | if (is_numeric($value) and $value > 0) { |
|
| 40 | 18 | return (double) $value * $this->dpr; |
|
| 41 | } |
||
| 42 | |||
| 43 | 10 | if (preg_match('/^(\d{1,2}(?!\d)|100)(w|h)$/', $value, $matches)) { |
|
| 44 | 6 | if ($matches[2] === 'h') { |
|
| 45 | 4 | return (double) $this->image->height() * ($matches[1] / 100); |
|
| 46 | } |
||
| 47 | |||
| 48 | 4 | return (double) $this->image->width() * ($matches[1] / 100); |
|
| 49 | } |
||
| 50 | 6 | } |
|
| 51 | } |
||
| 52 |