]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/criteria/class_BaseCriteria.php
Continued:
[core.git] / framework / main / classes / criteria / class_BaseCriteria.php
index e38926cf2e928fd3486b2518ca9930c664e30c08..db77c59e21d24eda8b25b70d599912bdc1bd029d 100644 (file)
@@ -236,10 +236,8 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                // Make sure no 'my-' or 'my_' passes this point
                assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
-
                // Add it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
                $this->pushValueToGenericArrayElement('criteria', 'choice', 'entries', StringUtils::convertDashesToUnderscores($criteriaKey), (string) $criteriaValue);
        }
 
@@ -264,7 +262,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      void
         */
-       public final function addConfiguredCriteria ($criteriaKey, $configEntry, string $criteriaType = 'default') {
+       public final function addConfiguredCriteria (string $criteriaKey, string $configEntry, string $criteriaType = 'default') {
                // Add the configuration entry as a criteria
                $value = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
                $this->addCriteria($criteriaKey, $value, $criteriaType);
@@ -277,20 +275,16 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      $value                  Whether the value of the critera or false
         */
-       public function getCriteriaElemnent ($criteriaKey, string $criteriaType = 'default') {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!');
-
+       public function getCriteriaElemnent (string $criteriaKey, string $criteriaType = 'default') {
                // Make sure no 'my-' or 'my_' passes this point
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!');
                assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
 
                // Convert dashes to underscore
                $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType));
-
                // Default is not found
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType));
                $value = false;
 
                // Is the criteria there?
@@ -299,10 +293,8 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                        $value = $this->getGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
                } // END - if
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: value=' . $value . ' - EXIT!');
-
                // Return the value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: value=' . $value . ' - EXIT!');
                return $value;
        }