|
@@ 191-193 (lines=3) @@
|
| 188 |
|
} |
| 189 |
|
// Unary operators need a single value. |
| 190 |
|
else if (!empty($operator) && $this->isUnaryOperator($operator)) { |
| 191 |
|
if (empty($value) || count($value) > 1) { |
| 192 |
|
throw new ResolveException(sprintf("Unary operators must be associated with a single value (field '%s').", $field)); |
| 193 |
|
} |
| 194 |
|
|
| 195 |
|
// Pick the first item from the values. |
| 196 |
|
$value = reset($value); |
|
@@ 200-202 (lines=3) @@
|
| 197 |
|
} |
| 198 |
|
// Range operators need exactly two values. |
| 199 |
|
else if (!empty($operator) && $this->isRangeOperator($operator)) { |
| 200 |
|
if (empty($value) || count($value) !== 2) { |
| 201 |
|
throw new ResolveException(sprintf("Range operators must require exactly two values (field '%s').", $field)); |
| 202 |
|
} |
| 203 |
|
} |
| 204 |
|
// Null operators can't have a value set. |
| 205 |
|
else if (!empty($operator) && $this->isNullOperator($operator)) { |