X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;h=822debf99fbfd5ac4c7fbca6c0eff4c311a3d695;hb=287198e6942b1a08c760c92d83b52105d10a11cb;hp=194ee491f16edff3825b8a113f7bd7db3d92554c;hpb=516c97967ce67dc0189a0eab88932a4401750699;p=core.git diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 194ee491..822debf9 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -602,7 +602,7 @@ Loaded includes: // Validate parameter if (empty($className)) { // Throw IAE - throw new InvalidArgumentException('Parameter "className" is empty'); + throw new InvalidArgumentException('Parameter "className" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!GenericRegistry::getRegistry()->instanceExists('debug')) { // Init debug instance $debugInstance = NULL; @@ -696,7 +696,7 @@ Loaded includes: } } else { // Are debug times enabled? - if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') { + if (FrameworkBootstrap::getConfigurationInstance()->isEnabled('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings')) { // Prepent it $message = $this->getPrintableExecutionTime() . $message; } @@ -799,7 +799,7 @@ Loaded includes: // Check parameter if (empty($fieldName)) { // Throw IAE - throw new InvalidArgumentException('Parameter "fieldName" is empty'); + throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // This method is deprecated @@ -852,7 +852,7 @@ Loaded includes: // Check parameter if (empty($fieldName)) { // Throw IAE - throw new InvalidArgumentException('Parameter "fieldName" is empty'); + throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Get result instance @@ -914,7 +914,7 @@ Loaded includes: // Check parameter if (empty($phpExtension)) { // Throw IAE - throw new InvalidArgumentException('Parameter "phpExtension" is empty'); + throw new InvalidArgumentException('Parameter "phpExtension" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Is it loaded? @@ -984,7 +984,7 @@ Loaded includes: // Check parameter if (empty($encodedData)) { // Throw IAE - throw new InvalidArgumentException('Parameter "encodedData" is empty'); + throw new InvalidArgumentException('Parameter "encodedData" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Determine it @@ -1030,16 +1030,16 @@ Loaded includes: // Check parameter if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Is it there? @@ -1058,17 +1058,17 @@ Loaded includes: * @return $isset Whether the given key is set * @throws InvalidArgumentException If a parameter is not valid */ - protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, $key) { + protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, string $key) { // Check parameter if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Is it there? @@ -1092,10 +1092,10 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Is it there? @@ -1119,10 +1119,10 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], true)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) { // No, then abort here throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s not found.', $keyGroup, $subGroup)); @@ -1141,18 +1141,18 @@ Loaded includes: * @return void * @throws InvalidArgumentException If a parameter is not valid */ - protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, $key) { + protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, string $key) { // Check parameter //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Remove it @@ -1174,16 +1174,16 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Remove it @@ -1205,13 +1205,13 @@ Loaded includes: //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Is it already there? @@ -1240,16 +1240,16 @@ Loaded includes: //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Is it already there? @@ -1278,10 +1278,10 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',forceInit=' . intval($forceInit)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (($forceInit === false) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) { // Already initialized throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s already initialized.', $keyGroup, $subGroup)); @@ -1307,13 +1307,13 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',forceInit=' . intval($forceInit)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (($forceInit === false) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) { // Already initialized throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s already initialized.', $keyGroup, $subGroup, gettype($key), $key)); @@ -1340,16 +1340,16 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',forceInit=' . intval($forceInit)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (($forceInit === false) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) { // Already initialized throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s,element[%s]=%s already initialized.', $keyGroup, $subGroup, gettype($key), $key, gettype($element), $element)); @@ -1369,18 +1369,18 @@ Loaded includes: * @return $count Number of array elements * @throws InvalidArgumentException If a parameter is not valid */ - protected final function pushValueToGenericArrayKey (string $keyGroup, string $subGroup, $key, $value) { + protected final function pushValueToGenericArrayKey (string $keyGroup, string $subGroup, string $key, $value) { // Check parameter //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Initialize array $this->initGenericArrayKey($keyGroup, $subGroup, $key); @@ -1411,16 +1411,16 @@ Loaded includes: //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) { // Initialize array $this->initGenericArrayElement($keyGroup, $subGroup, $key, $element); @@ -1445,18 +1445,18 @@ Loaded includes: * @throws InvalidArgumentException If a parameter is not valid * @throws BadMethodCallException If key/sub group isn't there but this method is invoked */ - protected final function popGenericArrayElement (string $keyGroup, string $subGroup, $key) { + protected final function popGenericArrayElement (string $keyGroup, string $subGroup, string $key) { // Check parameter //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Not found throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key)); @@ -1481,18 +1481,18 @@ Loaded includes: * @throws InvalidArgumentException If a parameter is not valid * @throws BadMethodCallException If key/sub group isn't there but this method is invoked */ - protected final function shiftGenericArrayElement (string $keyGroup, string $subGroup, $key) { + protected final function shiftGenericArrayElement (string $keyGroup, string $subGroup, string $key) { // Check parameter //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Not found throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key)); @@ -1520,7 +1520,7 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!isset($this->genericArray[$keyGroup])) { // Not found throw new BadMethodCallException(sprintf('keyGroup=%s not found.', $keyGroup)); @@ -1548,10 +1548,10 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) { // Abort here throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s not found.', $keyGroup, $subGroup)); @@ -1575,18 +1575,18 @@ Loaded includes: * @throws InvalidArgumentException If a parameter is not valid * @throws BadMethodCallException If key/sub group isn't there but this method is invoked */ - protected final function countGenericArrayElements (string $keyGroup, string $subGroup, $key) { + protected final function countGenericArrayElements (string $keyGroup, string $subGroup, string $key) { // Check parameter //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Abort here throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key)); @@ -1616,7 +1616,7 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!isset($this->genericArray[$keyGroup])) { // Then abort here throw new BadMethodCallException(sprintf('keyGroup=%s not found', $keyGroup)); @@ -1637,18 +1637,18 @@ Loaded includes: * @throws InvalidArgumentException If a parameter is not valid * @throws BadMethodCallException If key/sub group isn't there but this method is invoked */ - protected final function setGenericArrayKey (string $keyGroup, string $subGroup, $key, $value) { + protected final function setGenericArrayKey (string $keyGroup, string $subGroup, string $key, $value) { // Check parameters //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isValidGenericArrayGroup($keyGroup, $subGroup)) { // Then abort here throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s not found', $keyGroup)); @@ -1668,18 +1668,18 @@ Loaded includes: * @throws InvalidArgumentException If a parameter is not valid * @throws BadMethodCallException If key/sub group isn't there but this method is invoked */ - protected final function getGenericArrayKey (string $keyGroup, string $subGroup, $key) { + protected final function getGenericArrayKey (string $keyGroup, string $subGroup, string $key) { // Check parameters //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Then abort here throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key)); @@ -1705,16 +1705,16 @@ Loaded includes: //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true)); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) { // Initialize array $this->initGenericArrayElement($keyGroup, $subGroup, $key, $element); @@ -1740,16 +1740,16 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); - } elseif (empty($element)) { + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); + } elseif ($element === '') { // Throw IAE - throw new InvalidArgumentException('Parameter "element" is empty'); + throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) { // Then abort here throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s,element[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key, gettype($element), $element)); @@ -1772,10 +1772,10 @@ Loaded includes: //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Determine it @@ -1793,18 +1793,18 @@ Loaded includes: * @param $key Key to check * @return $isValid Whether given sub group is valid */ - protected final function isValidGenericArrayKey (string $keyGroup, string $subGroup, $key) { + protected final function isValidGenericArrayKey (string $keyGroup, string $subGroup, string $key) { // Check parameters //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); if (empty($keyGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "keyGroup" is empty'); + throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($subGroup)) { // Throw IAE - throw new InvalidArgumentException('Parameter "subGroup" is empty'); + throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" is empty'); + throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } // Determine it