| Conditions | 5 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | protected function buildOffset(string $query): string { |
||
| 34 | $offset = $this->getOffset(); |
||
| 35 | if($this->offset instanceof OptionalValue) { |
||
| 36 | if($this->offset->isValid()) { |
||
| 37 | $value = $this->offset->getValue(); |
||
| 38 | if(!preg_match('{\\d+}', $value)) { |
||
| 39 | throw new InvalidValueException('Value for OFFSET has to be a number'); |
||
| 40 | } |
||
| 41 | $query .= "OFFSET\n\t{$this->offset->getValue()}\n"; |
||
| 42 | } |
||
| 43 | } elseif($offset !== null) { |
||
| 44 | $query .= "OFFSET\n\t{$this->offset}\n"; |
||
| 45 | } |
||
| 46 | return $query; |
||
| 47 | } |
||
| 49 |