Skip to content

Commit 009bd62

Browse files
committed
Merge pull request #46 from lex009/master
Type of value returned by Sql2ToQomQueryConverter::parseLiteral becomes more accurate
2 parents 98d2950 + 131c50e commit 009bd62

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,13 @@ protected function parseLiteral()
700700
throw new \Exception("Syntax error: unterminated quoted string $token in '{$this->sql2}'");
701701
}
702702

703-
$token = substr($token, 1, -1);
703+
$token = substr($token, 1, -1);
704+
} else if (is_numeric($token)){
705+
$token = strpos($token, '.') === false ? (int) $token : (float) $token;
706+
} else if ($token == 'true') {
707+
$token = true;
708+
} else if ($token == 'false') {
709+
$token = false;
704710
}
705711

706712
return $this->factory->literal($token);

0 commit comments

Comments
 (0)