projects
/
m6w6
/
pq-gateway
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
simplify
[m6w6/pq-gateway]
/
lib
/
pq
/
Query
/
Expr.php
diff --git
a/lib/pq/Query/Expr.php
b/lib/pq/Query/Expr.php
index 0f3d86e52ba1db3ae3cfb99ca9391e7f3e2396e1..31e8c969b290f21a3653a6a20e3faae7fa465846 100644
(file)
--- a/
lib/pq/Query/Expr.php
+++ b/
lib/pq/Query/Expr.php
@@
-18,7
+18,7
@@
class Expr
* @param string $e the expression or a format string followed by arguments
* @param string ...
*/
* @param string $e the expression or a format string followed by arguments
* @param string ...
*/
- function __construct($e
, $arg = null
) {
+ function __construct($e) {
if (func_num_args() > 1) {
$e = call_user_func_array("sprintf", func_get_args());
}
if (func_num_args() > 1) {
$e = call_user_func_array("sprintf", func_get_args());
}
@@
-52,11
+52,14
@@
class Expr
* @throws \UnexpectedValueException if any expr is NULL
*/
function add(Expr $next) {
* @throws \UnexpectedValueException if any expr is NULL
*/
function add(Expr $next) {
- if ($this->isNull()
|| $next->isNull()
) {
+ if ($this->isNull()) {
throw new \UnexpectedValueException("Cannot add anything to NULL");
}
throw new \UnexpectedValueException("Cannot add anything to NULL");
}
- for ($that = $this; $that->next; $that = $that->next);
- $that->next = $next;
+ if ($this->next) {
+ $this->next->add($next);
+ } else {
+ $this->next = $next;
+ }
return $this;
}
}
return $this;
}
}