diff options
author | Michal Čihař <michal@cihar.com> | 2016-11-30 11:56:53 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2016-11-30 11:56:53 +0100 |
commit | ed8a27d716b4b111118eb4802276dd84b1450b98 (patch) | |
tree | 7ea609580111389146e9f9ef1ffd3a949a7e8c9a | |
parent | 48acd1a27b4b428d1df6f300fa136c3a6874a96c (diff) | |
download | sql-parser-ed8a27d716b4b111118eb4802276dd84b1450b98.zip sql-parser-ed8a27d716b4b111118eb4802276dd84b1450b98.tar.gz sql-parser-ed8a27d716b4b111118eb4802276dd84b1450b98.tar.bz2 |
Use strlen on strings instead of count
This fails in PHP 7.2
Signed-off-by: Michal Čihař <michal@cihar.com>
-rw-r--r-- | src/Components/Expression.php | 2 | ||||
-rw-r--r-- | src/Statements/DeleteStatement.php | 2 | ||||
-rw-r--r-- | src/Statements/InsertStatement.php | 2 | ||||
-rw-r--r-- | src/Statements/ReplaceStatement.php | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/Components/Expression.php b/src/Components/Expression.php index e407960..7a7a333 100644 --- a/src/Components/Expression.php +++ b/src/Components/Expression.php @@ -261,7 +261,7 @@ class Expression extends Component continue; } $isExpr = true; - } elseif ($brackets === 0 && count($ret->expr) > 0 && ! $alias) { + } elseif ($brackets === 0 && strlen($ret->expr) > 0 && ! $alias) { /* End of expression */ break; } diff --git a/src/Statements/DeleteStatement.php b/src/Statements/DeleteStatement.php index 0c66138..d83d0e9 100644 --- a/src/Statements/DeleteStatement.php +++ b/src/Statements/DeleteStatement.php @@ -154,7 +154,7 @@ class DeleteStatement extends Statement if ($this->order != NULL && count($this->order) > 0) { $ret .= ' ORDER BY ' . ExpressionArray::build($this->order); } - if ($this->limit != NULL && count($this->limit) > 0) { + if ($this->limit != NULL && strlen($this->limit) > 0) { $ret .= ' LIMIT ' . Limit::build($this->limit); } diff --git a/src/Statements/InsertStatement.php b/src/Statements/InsertStatement.php index 2270f58..82b6bc8 100644 --- a/src/Statements/InsertStatement.php +++ b/src/Statements/InsertStatement.php @@ -121,7 +121,7 @@ class InsertStatement extends Statement $ret .= ' VALUES ' . Array2d::build($this->values); } elseif ($this->set != NULL && count($this->set) > 0) { $ret .= ' SET ' . SetOperation::build($this->set); - } elseif ($this->select != NULL && count($this->select) > 0) { + } elseif ($this->select != NULL && strlen($this->select) > 0) { $ret .= ' ' . $this->select->build(); } diff --git a/src/Statements/ReplaceStatement.php b/src/Statements/ReplaceStatement.php index 4142c88..0e85507 100644 --- a/src/Statements/ReplaceStatement.php +++ b/src/Statements/ReplaceStatement.php @@ -99,7 +99,7 @@ class ReplaceStatement extends Statement $ret .= ' VALUES ' . Array2d::build($this->values); } elseif ($this->set != NULL && count($this->set) > 0) { $ret .= ' SET ' . SetOperation::build($this->set); - } elseif ($this->select != NULL && count($this->select) > 0) { + } elseif ($this->select != NULL && strlen($this->select) > 0) { $ret .= ' ' . $this->select->build(); } |