use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Loader\ClassLoader;
+use Org\Mxchange\CoreFramework\Logging\Logger;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
/**
* Setter for debug instance
*
- * @param $debugInstance The instance for debug output class
+ * @param $debugInstance An instance of a Logger class
* @return void
*/
- public final function setDebugInstance (DebugMiddleware $debugInstance): void {
+ public final function setDebugInstance (Logger $debugInstance): void {
self::$debugInstance = $debugInstance;
}
*
* @return $debugInstance Instance to class DebugConsoleOutput or DebugWebOutput
*/
- public final function getDebugInstance (): DebugMiddleware {
+ public final function getDebugInstance (): Logger {
return self::$debugInstance;
}
* @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 = 0): DebugMiddleware {
+ public final static function createDebugInstance (string $className, int $lineNumber = 0): Logger {
// 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 self::$debugInstance;
}
- /**
- * Simple output of a message with line-break
- *
- * @param $message Message to output
- * @return void
- * @throws InvalidArgumentException If a paramter has an invalid value
- */
- 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)) {
- // Throw IAE
- throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
- }
-
- // Simply output it
- print($message . PHP_EOL);
- }
-
/**
* Marks up the code by adding e.g. line numbers
*
* @return $entry An array with database entries
* @throws NullPointerException If the database result is not found
* @throws InvalidDatabaseResultException If the database result is invalid
- * @deprecated Monolithic method, should be moved to proper classes
+ * @deprecated Monolithic method, should be avoided by using DatabaseResult classes instead
*/
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');
+ $this->deprecationWarning('Monolithic method, should be avoided by using DatabaseResult classes instead');
// Is there an instance?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->resultInstance[]=%s', gettype($this->getResultInstance())));
* @return $fieldValue Field value from the user
* @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
+ * @deprecated Monolithic method, should be avoided by using DatabaseResult classes instead
*/
public final function getField (string $fieldName): mixed {
// Check parameter
}
// This method is deprecated
- $this->deprecationWarning('Monolithic method, should be moved to proper classes');
+ $this->deprecationWarning('Monolithic method, should be avoided by using DatabaseResult classes instead');
// Default field value
$fieldValue = NULL;
* @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
+ * @deprecated Monolithic method, should be avoided by using DatabaseResult classes instead
*/
public function isFieldSet (string $fieldName): bool {
// Check parameter
}
// This method is deprecated
- $this->deprecationWarning('Monolithic method, should be moved to proper classes');
+ $this->deprecationWarning('Monolithic method, should be avoided by using DatabaseResult classes instead');
// Get result instance
$resultInstance = $this->getResultInstance();
return $hasSlept;
}
- /**
- * Checks whether the given encoded data was encoded with Base64
- *
- * @param $encodedData Encoded data we shall check
- * @return $isBase64 Whether the encoded data is Base64
- * @throws InvalidArgumentException If a parameter is not valid
- */
- 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)) {
- // Throw IAE
- throw new InvalidArgumentException('Parameter "encodedData" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
- }
-
- // Determine it
- $isBase64 = (@base64_decode($encodedData, true) !== false);
-
- // Return it
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isBase64=%d - EXIT!', intval($isBase64)));
- return $isBase64;
- }
-
/**
* Getter for startup time in miliseconds
*
* @return $fieldValue Field value from the user
* @throws NullPointerException If the result instance is null
*/
- function getField (string $fieldName);
+ function getField (string $fieldName): mixed;
/**
* Checks if given field is set
* @return $isSet Whether the given field name is set
* @throws NullPointerException If the result instance is null
*/
- function isFieldSet (string $fieldName);
+ function isFieldSet (string $fieldName): bool;
/**
* Setter for call-back instance
* @param $callbackInstance An instance of a FrameworkInterface class
* @return void
*/
- function setCallbackInstance (FrameworkInterface $callbackInstance);
+ function setCallbackInstance (FrameworkInterface $callbackInstance): void;
/**
* Checks whether an object equals this object. You should overwrite this
* @param $objectInstance An instance of a FrameworkInterface object
* @return $equals Whether both objects equals
*/
- function equals (FrameworkInterface $objectInstance);
+ function equals (FrameworkInterface $objectInstance): bool;
/**
* Generates a code for hashes from this class
*
* @return $hashCode The hash code respresenting this class
*/
- function hashCode ();
+ function hashCode (): int;
}