From: Matthias Schmidt Date: Thu, 9 Aug 2012 10:36:47 +0000 (+0200) Subject: Enhances method documentation in PreparedStatementConditionBuilder X-Git-Tag: 2.0.0_Beta_1~961^2~2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4885214dd8777e3fbdba008ae366fc949fe26f41;p=GitHub%2FWoltLab%2FWCF.git Enhances method documentation in PreparedStatementConditionBuilder Also, `count` was replaced with `!empty`. --- 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) {