From 4885214dd8777e3fbdba008ae366fc949fe26f41 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 9 Aug 2012 12:36:47 +0200 Subject: [PATCH] Enhances method documentation in PreparedStatementConditionBuilder Also, `count` was replaced with `!empty`. --- .../util/PreparedStatementConditionBuilder.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php b/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php index c66c6524f9..17ea88280a 100644 --- a/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php +++ b/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php @@ -20,13 +20,13 @@ class PreparedStatementConditionBuilder extends ConditionBuilder { protected $parameters = array(); /** - * Adds a new condition. + * Adds a new condition. The parameters array has to be a numbered array. * * @param string $condition * @param array $parameters */ public function add($condition, array $parameters = array()) { - if (count($parameters)) { + if (!empty($parameters)) { $count = 0; $callback = function ($matches) use (&$count, $parameters, $condition) { if (!array_key_exists($count, $parameters)) { @@ -50,7 +50,7 @@ class PreparedStatementConditionBuilder extends ConditionBuilder { $this->conditions .= $condition; // parameter handling - if (count($parameters)) { + if (!empty($parameters)) { foreach ($parameters as $parameter) { if (is_array($parameter)) { foreach ($parameter as $value) { -- 2.20.1