| Conditions | 5 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 15 | public function checkHasRatio(string $ratio, bool $throwException = false) |
||
| 16 | { |
||
| 17 | foreach ($this->value as $item) { |
||
| 18 | if (! empty($item->offsetGet('ratio')) |
||
| 19 | && $item->offsetGet('ratio') === $ratio |
||
| 20 | ) { |
||
| 21 | return $this; |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | $this->setErrorMessage("Doesn't have vertical which is " . $ratio . ' ratio'); |
||
| 26 | |||
| 27 | if ($throwException) { |
||
| 28 | throw new \Exception($this->getErrorMessage(), 1); |
||
| 29 | } |
||
| 40 |