| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 83 | public function parse($resolution) { |
||
| 84 | preg_match_all(self::RESOLUTION_FORMAT, $resolution, $matches); |
||
| 85 | $message = "Cannot parse provided resolution '{$resolution}'. It must be in the following format: 360x640"; |
||
| 86 | assert($matches, isNotEmpty()->and(hasKey(0))->and(hasKey(1))->and(hasKey(2)), $message); |
||
| 87 | assert($matches[1][0], isNotEmpty(), $message); |
||
| 88 | assert($matches[2][0], isNotEmpty(), $message); |
||
| 89 | $this->setWidth($matches[1][0]); |
||
| 90 | $this->setHeight($matches[2][0]); |
||
| 91 | return $this; |
||
| 92 | } |
||
| 93 | |||
| 95 |