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