*
* @return $realClass The name of the real class (not BaseFrameworkSystem)
*/
- public function __toString () {
+ public function __toString (): string {
return $this->realClass;
}
* @param $value Value to store
* @return void
*/
- public final function __set (string $name, $value) {
+ public final function __set (string $name, mixed $value): void {
$this->debugBackTrace(sprintf('Tried to set a missing field. name=%s, value[%s]=%s',
$name,
gettype($value),
* @param $name Name of the field/attribute
* @return void
*/
- public final function __get (string $name) {
+ public final function __get (string $name): void {
$this->debugBackTrace(sprintf('Tried to get a missing field. name=%s',
$name
));
* @param $name Name of the field/attribute
* @return void
*/
- public final function __unset (string $name) {
+ public final function __unset (string $name): void {
$this->debugBackTrace(sprintf('Tried to unset a missing field. name=%s',
$name
));
* @param $realClass Class name (string)
* @return void
*/
- public final function setRealClass (string $realClass) {
+ public final function setRealClass (string $realClass): void {
// Set real class
$this->realClass = $realClass;
}
* @param $debugInstance The instance for debug output class
* @return void
*/
- public final function setDebugInstance (DebugMiddleware $debugInstance) {
+ public final function setDebugInstance (DebugMiddleware $debugInstance): void {
self::$debugInstance = $debugInstance;
}
*
* @return $debugInstance Instance to class DebugConsoleOutput or DebugWebOutput
*/
- public final function getDebugInstance () {
+ public final function getDebugInstance (): DebugMiddleware {
return self::$debugInstance;
}
* @param $webInstance The instance for web output class
* @return void
*/
- public final function setWebOutputInstance (OutputStreamer $webInstance) {
+ public final function setWebOutputInstance (OutputStreamer $webInstance): void {
ObjectRegistry::getRegistry('generic')->addInstance('web_output', $webInstance);
}
*
* @return $webOutputInstance - Instance to class WebOutput
*/
- public final function getWebOutputInstance () {
+ public final function getWebOutputInstance (): OutputStreamer {
return ObjectRegistry::getRegistry('generic')->getInstance('web_output');
}
* @param $callbackInstance An instance of a FrameworkInterface class
* @return void
*/
- public final function setCallbackInstance (FrameworkInterface $callbackInstance) {
+ public final function setCallbackInstance (FrameworkInterface $callbackInstance): void {
$this->callbackInstance = $callbackInstance;
}
*
* @return $callbackInstance An instance of a FrameworkInterface class
*/
- protected final function getCallbackInstance () {
+ protected final function getCallbackInstance (): FrameworkInterface {
return $this->callbackInstance;
}
* @param $objectInstance An instance of a FrameworkInterface object
* @return $equals Whether both objects equals
*/
- public function equals (FrameworkInterface $objectInstance) {
+ public function equals (FrameworkInterface $objectInstance): bool {
// Now test it
$equals = ((
$this->__toString() == $objectInstance->__toString()
*
* @return $hashCode A generic hash code respresenting this whole class
*/
- public function hashCode () {
+ public function hashCode (): int {
// Simple hash code
return crc32($this->__toString());
}
* @return $str A string with an auto-appended trailing slash
* @throws InvalidArgumentException If a paramter has an invalid value
*/
- public final function addMissingTrailingSlash (string $str) {
+ public final function addMissingTrailingSlash (string $str): string {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: str=%s - CALLED!', $str));
if (empty($str)) {
* @return void
* @throws InvalidArgumentException If a paramter has an invalid value
*/
- public final function debugInstance (string $message = '') {
+ public final function debugInstance (string $message = ''): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s - CALLED!', $message));
if (empty($message)) {
* @return void
* @throws InvalidArgumentException If a paramter has an invalid value
*/
- public function debugBackTrace (string $message = '', bool $doExit = true) {
+ public function debugBackTrace (string $message = '', bool $doExit = true): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s,doExit=%d - CALLED!', $message, intval($doExit)));
if (empty($message)) {
* @throws InvalidArgumentException If a parameter has an invalid value
* @deprecated Not fully, as the new Logger facilities are not finished yet.
*/
- public final static function createDebugInstance (string $className, int $lineNumber = NULL) {
+ public final static function createDebugInstance (string $className, int $lineNumber = 0): DebugMiddleware {
// Validate parameter
//* NOISY-DEBUG: */ printf('[%s:%d]: className=%s,lineNumber[%s]=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className, gettype($lineNumber), $lineNumber);
if (empty($className)) {
* @return void
* @throws InvalidArgumentException If a paramter has an invalid value
*/
- public function outputLine (string $message) {
+ public function outputLine (string $message): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s - CALLED!', $message));
if (empty($message)) {
* @return $markedCode Marked PHP code
* @throws InvalidArgumentException If a paramter has an invalid value
*/
- public function markupCode (string $phpCode) {
+ public function markupCode (string $phpCode): string {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: phpCode=%s - CALLED!', $phpCode));
if (empty($phpCode)) {
* @throws InvalidDatabaseResultException If the database result is invalid
* @deprecated Monolithic method, should be moved to proper classes
*/
- protected final function getDatabaseEntry () {
+ protected final function getDatabaseEntry (): array {
// This method is deprecated
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
$this->deprecationWarning('Monolithic method, should be moved to proper classes');
* @throws InvalidArgumentException If a parameter is not valid
* @deprecated Monolithic method, should be moved to proper classes
*/
- public final function getField (string $fieldName) {
+ public final function getField (string $fieldName): mixed {
// Check parameter
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldName=%s - CALLED!', $fieldName));
if (empty($fieldName)) {
* @return $isSet Whether the given field name is set
* @throws NullPointerException If the result instance is null
* @throws InvalidArgumentException If a parameter is not valid
+ * @deprecated Monolithic method, should be moved to proper classes
*/
- public function isFieldSet (string $fieldName) {
+ public function isFieldSet (string $fieldName): bool {
// Check parameter
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldName=%s - CALLED!', $fieldName));
if (empty($fieldName)) {
throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
}
+ // This method is deprecated
+ $this->deprecationWarning('Monolithic method, should be moved to proper classes');
+
// Get result instance
$resultInstance = $this->getResultInstance();
* @throws InvalidArgumentException If a paramter has an invalid value
* @todo Write a logging mechanism for productive mode
*/
- public function deprecationWarning (string $message) {
+ public function deprecationWarning (string $message): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s - CALLED!', $message));
if (empty($message)) {
* @return $isLoaded Whether the PHP extension is loaded
* @throws InvalidArgumentException If a parameter is not valid
*/
- public final function isPhpExtensionLoaded (string $phpExtension) {
+ public final function isPhpExtensionLoaded (string $phpExtension): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: phpExtension=%s - CALLED!', $phpExtension));
if (empty($phpExtension)) {
*
* @return $milliTime Timestamp with milliseconds
*/
- public function getMilliTime () {
+ public function getMilliTime (): float {
// Get the time of day as float
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
$milliTime = gettimeofday(true);
* @return $hasSlept Whether it goes fine
* @throws InvalidArgumentException If a parameter is not valid
*/
- public function idle (int $milliSeconds) {
+ public function idle (int $milliSeconds): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: milliSeconds=%s - CALLED!', $milliSeconds));
if ($milliSeconds < 1) {
* @return $isBase64 Whether the encoded data is Base64
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected function isBase64Encoded (string $encodedData) {
+ protected function isBase64Encoded (string $encodedData): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: encodedData=%s - CALLED!', $encodedData));
if (empty($encodedData)) {
*
* @return $startupTime Startup time in miliseconds
*/
- protected function getStartupTime () {
+ protected function getStartupTime (): float {
return self::$startupTime;
}
*
* @return $executionTime Current execution time in nice braces
*/
- protected function getPrintableExecutionTime () {
+ protected function getPrintableExecutionTime (): string {
// Calculate execution time and pack it in nice braces
$executionTime = sprintf('[ %01.5f ] ', (microtime(true) - $this->getStartupTime()));
* @return $isset Whether the given key is set
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function isGenericArrayElementSet (string $keyGroup, string $subGroup, string $key, string $element) {
+ protected final function isGenericArrayElementSet (string $keyGroup, string $subGroup, string $key, string $element): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s - CALLED!', $keyGroup, $subGroup, $key, $element));
if (empty($keyGroup)) {
* @return $isset Whether the given key is set
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, string $key) {
+ protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, string $key): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
* @return $isset Whether the given group is set
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function isGenericArrayGroupSet (string $keyGroup, string $subGroup) {
+ protected final function isGenericArrayGroupSet (string $keyGroup, string $subGroup): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
if (empty($keyGroup)) {
* @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 getGenericSubArray (string $keyGroup, string $subGroup) {
+ protected final function getGenericSubArray (string $keyGroup, string $subGroup): array {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
if (empty($keyGroup)) {
* @return void
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, string $key) {
+ protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, string $key): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
* @return void
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function unsetGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element) {
+ protected final function unsetGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s - CALLED!', $keyGroup, $subGroup, $key, $element));
if (empty($keyGroup)) {
* @return void
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function appendStringToGenericArrayKey (string $keyGroup, string $subGroup, string $key, string $value, string $appendGlue = '') {
+ protected final function appendStringToGenericArrayKey (string $keyGroup, string $subGroup, string $key, string $value, string $appendGlue = ''): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,value=%s,appendGlue=%s - CALLED!', $keyGroup, $subGroup, $key, $value, $appendGlue));
if (empty($keyGroup)) {
* @return void
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function appendStringToGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, string $value, string $appendGlue = '') {
+ protected final function appendStringToGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, string $value, string $appendGlue = ''): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,value=%s,appendGlue=%s - CALLED!', $keyGroup, $subGroup, $key, $element, $value, $appendGlue));
if (empty($keyGroup)) {
* @throws InvalidArgumentException If a parameter is not valid
* @throws BadMethodCallException If key/sub group has already been initialized
*/
- protected final function initGenericArrayGroup (string $keyGroup, string $subGroup, bool $forceInit = false) {
+ protected final function initGenericArrayGroup (string $keyGroup, string $subGroup, bool $forceInit = false): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,forceInit=%d - CALLED!', $keyGroup, $subGroup, intval($forceInit)));
if (empty($keyGroup)) {
* @throws InvalidArgumentException If a parameter is not valid
* @throws BadMethodCallException If key/sub group has already been initialized
*/
- protected final function initGenericArrayKey (string $keyGroup, string $subGroup, string $key, bool $forceInit = false) {
+ protected final function initGenericArrayKey (string $keyGroup, string $subGroup, string $key, bool $forceInit = false): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,forceInit=%d - CALLED!', $keyGroup, $subGroup, $key, intval($forceInit)));
if (empty($keyGroup)) {
* @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 initGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, bool $forceInit = false) {
+ protected final function initGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, bool $forceInit = false): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,forceInit=%d - CALLED!', $keyGroup, $subGroup, $key, $element, intval($forceInit)));
if (empty($keyGroup)) {
* @return $count Number of array elements
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function pushValueToGenericArrayKey (string $keyGroup, string $subGroup, string $key, $value) {
+ protected final function pushValueToGenericArrayKey (string $keyGroup, string $subGroup, string $key, mixed $value): int {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, gettype($value)));
if (empty($keyGroup)) {
* @return $count Number of array elements
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function pushValueToGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, $value) {
+ protected final function pushValueToGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, mixed $value): int {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, $element, gettype($value)));
if (empty($keyGroup)) {
* @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, string $key) {
+ protected final function popGenericArrayElement (string $keyGroup, string $subGroup, string $key): mixed {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
* @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, string $key) {
+ protected final function shiftGenericArrayElement (string $keyGroup, string $subGroup, string $key): mixed {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
* @throws InvalidArgumentException If a parameter is not valid
* @throws BadMethodCallException If key group isn't there but this method is invoked
*/
- protected final function countGenericArray (string $keyGroup) {
+ protected final function countGenericArray (string $keyGroup): int {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s - CALLED!', $keyGroup));
if (empty($keyGroup)) {
* @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 countGenericArrayGroup (string $keyGroup, string $subGroup) {
+ protected final function countGenericArrayGroup (string $keyGroup, string $subGroup): int {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
if (empty($keyGroup)) {
* @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, string $key) {
+ protected final function countGenericArrayElements (string $keyGroup, string $subGroup, string $key): int {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
* @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 getGenericArray (string $keyGroup) {
+ protected final function getGenericArray (string $keyGroup): array {
// Check parameters
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s - CALLED!', $keyGroup));
if (empty($keyGroup)) {
* @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, string $key, $value) {
+ protected final function setGenericArrayKey (string $keyGroup, string $subGroup, string $key, mixed $value): void {
// Check parameters
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, gettype($value)));
if (empty($keyGroup)) {
* @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, string $key) {
+ protected final function getGenericArrayKey (string $keyGroup, string $subGroup, string $key): mixed {
// Check parameters
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
* @return void
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function setGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, $value) {
+ protected final function setGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, mixed $value): void {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, $element, gettype($value)));
if (empty($keyGroup)) {
* @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 getGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element) {
+ protected final function getGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element): mixed {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s - CALLED!', $keyGroup, $subGroup, $key, $element));
if (empty($keyGroup)) {
* @return $isValid Whether given sub group is valid
* @throws InvalidArgumentException If a parameter is not valid
*/
- protected final function isValidGenericArrayGroup (string $keyGroup, string $subGroup) {
+ protected final function isValidGenericArrayGroup (string $keyGroup, string $subGroup): bool {
// Check parameter
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
if (empty($keyGroup)) {
* @param $key Key to check
* @return $isValid Whether given sub group is valid
*/
- protected final function isValidGenericArrayKey (string $keyGroup, string $subGroup, string $key) {
+ protected final function isValidGenericArrayKey (string $keyGroup, string $subGroup, string $key): bool {
// Check parameters
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
if (empty($keyGroup)) {
*
* @return void
*/
- protected function initWebOutputInstance () {
+ protected function initWebOutputInstance (): void {
// Init web output instance
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
$outputInstance = ObjectFactory::createObjectByConfiguredName('output_class');
* @param $boolean Boolean value
* @return $translated Translated boolean value
*/
- public static final function translateBooleanToYesNo (bool $boolean) {
+ public static final function translateBooleanToYesNo (bool $boolean): string {
// "Translate" it
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: boolean=%d - CALLED!', intval($boolean)));
$translated = ($boolean === true) ? 'Y' : 'N';
* @throw PathWriteProtectedException If the path in 'temp_file_path' is write-protected
* @throws FileIoException If the file cannot be written
*/
- protected static function createTempPathForFile (SplFileInfo $infoInstance) {
+ protected static function createTempPathForFile (SplFileInfo $infoInstance): SplFileInfo {
// Get config entry
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: infoInstance=%s - CALLED!', $infoInstance->__toString()));
$basePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('temp_file_path');
*
* @return $stateName Name of the node's state in a printable format
* @throws BadMethodCallException If this instance doesn't have a callable getter for stateInstance
- * @todo Move this class away from this monolithic place (not whole class is monolithic)
+ * @deprecated Monolithic method, should be moved to proper classes
*/
- public final function getPrintableState () {
+ public final function getPrintableState (): string {
// Check if getter is there
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
if (!is_callable($this, 'getStateInstance')) {
throw new BadMethodCallException(sprintf('this=%s has no callable getter for stateInstance', $this->__toString()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
}
+ // This method is deprecated
+ $this->deprecationWarning('Monolithic method, should be moved to proper classes');
+
// Default is 'null'
$stateName = 'null';