Skip to content

Commit a901940

Browse files
committed
cometics
1 parent 7860548 commit a901940

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,20 @@ protected function parseConstraint($lhs = null, $minprec = 0)
340340
$nextop = strtoupper($this->scanner->lookupNextToken());
341341
}
342342

343-
if ($op == 'AND') {
344-
$lhs = $this->factory->andConstraint($lhs, $rhs);
345-
} elseif ($op == 'OR') {
346-
$lhs = $this->factory->orConstraint($lhs, $rhs);
347-
} else {
348-
// this only happens if the operator is
349-
// in the $opprec-array but there is no
350-
// "elseif"-branch here for this operator.
351-
throw new \Exception(
352-
"Internal error: No action is defined for operator '$op'"
353-
);
343+
switch ($op) {
344+
case 'AND':
345+
$lhs = $this->factory->andConstraint($lhs, $rhs);
346+
break;
347+
case 'OR':
348+
$lhs = $this->factory->orConstraint($lhs, $rhs);
349+
break;
350+
default:
351+
// this only happens if the operator is
352+
// in the $opprec-array but there is no
353+
// "elseif"-branch here for this operator.
354+
throw new \Exception(
355+
"Internal error: No action is defined for operator '$op'"
356+
);
354357
}
355358

356359
$op = strtoupper($this->scanner->lookupNextToken());

0 commit comments

Comments
 (0)