@@ 270-272 (lines=3) @@ | ||
267 | } |
|
268 | // Unary operators need a single value. |
|
269 | else if (!empty($operator) && $this->isUnaryOperator($operator)) { |
|
270 | if (empty($value) || count($value) > 1) { |
|
271 | throw new ResolveException(sprintf("Unary operators must be associated with a single value (field '%s').", $field)); |
|
272 | } |
|
273 | ||
274 | // Pick the first item from the values. |
|
275 | $value = reset($value); |
|
@@ 279-281 (lines=3) @@ | ||
276 | } |
|
277 | // Range operators need exactly two values. |
|
278 | else if (!empty($operator) && $this->isRangeOperator($operator)) { |
|
279 | if (empty($value) || count($value) !== 2) { |
|
280 | throw new ResolveException(sprintf("Range operators must require exactly two values (field '%s').", $field)); |
|
281 | } |
|
282 | } |
|
283 | // Null operators can't have a value set. |
|
284 | else if (!empty($operator) && $this->isNullOperator($operator)) { |