From 8b24c586a618ebeb4addc98062a7a7acd03cc98a Mon Sep 17 00:00:00 2001 From: Michal Drozd Date: Mon, 16 Mar 2020 12:13:59 +0000 Subject: [PATCH] Correct deprecated methods in PHP7.4 (#1079) * runtime/lib/query/Join.php implode() was used against the definition (wrong PHP documentation * runtime/lib/query/ModelCriteria.php count() was used on non-countable variable (non-array) --- runtime/lib/query/Join.php | 2 +- runtime/lib/query/ModelCriteria.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/lib/query/Join.php b/runtime/lib/query/Join.php index b9a78ab5b..be3f37784 100644 --- a/runtime/lib/query/Join.php +++ b/runtime/lib/query/Join.php @@ -537,7 +537,7 @@ public function getClause(&$params) for ($i = 0; $i < $this->count; $i++) { $conditions [] = $this->getLeftColumn($i) . $this->getOperator($i) . $this->getRightColumn($i); } - $joinCondition = sprintf('(%s)', implode($conditions, ' AND ')); + $joinCondition = sprintf('(%s)', implode(' AND ', $conditions)); } else { $joinCondition = ''; $this->getJoinCondition()->appendPsTo($joinCondition, $params); diff --git a/runtime/lib/query/ModelCriteria.php b/runtime/lib/query/ModelCriteria.php index e68c0836b..5ea69007b 100644 --- a/runtime/lib/query/ModelCriteria.php +++ b/runtime/lib/query/ModelCriteria.php @@ -525,7 +525,7 @@ public function offset($offset) */ public function select($columnArray) { - if (!count($columnArray) || $columnArray == '') { + if (empty($columnArray)) { throw new PropelException('You must ask for at least one column'); }