From: Roland Häder Date: Fri, 10 Feb 2023 15:57:00 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cf56ceb021cf54f4031c6d863e16cbf700b9d95a;p=core.git Continued: - thanks to type-hints, I was able to find out that appendStringToGenericArrayElement() was invoked wrong here, it must be setGenericArrayElement() instead which makes sense from addCriteria() method's scope --- diff --git a/framework/main/classes/criteria/class_BaseCriteria.php b/framework/main/classes/criteria/class_BaseCriteria.php index ad57f0be..a9c90b93 100644 --- a/framework/main/classes/criteria/class_BaseCriteria.php +++ b/framework/main/classes/criteria/class_BaseCriteria.php @@ -274,7 +274,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { */ public final function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) { // Check parameter - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s--CRITERIA: criteriaKey=%s,criteriaValue[]=%s$criteriaValue,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaType)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[]=%s,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaType)); if (empty($criteriaKey)) { // Throw IAE throw new InvalidArgumentException('Parameter "criteriaKey" is empty'); @@ -295,9 +295,9 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { // Convert dashes to underscore $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey); - // Append it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: Invoking this->appendStringToGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey, gettype($criteriaValue))); - $this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue); + // Set it + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: Invoking this->setGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey, gettype($criteriaValue))); + $this->setGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue); // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: EXIT!', strtoupper($criteriaType)));