use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
use Org\Mxchange\CoreFramework\Filesystem\PathWriteProtectedException;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*/
private static $selfInstance = NULL;
+ /**
+ * Stub methods
+ */
+ private static $stubMethods = [
+ 'partialStub' => true,
+ '__call' => true,
+ '__callStatic' => true,
+ ];
+
/**
* The real class name
*/
* @throws UnsupportedOperationException Objects of this framework cannot be serialized
*/
public final function __sleep () {
- throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+ throw new UnsupportedOperationException([$this, __FUNCTION__], self::EXCEPTION_UNSPPORTED_OPERATION);
}
/**
* @throws UnsupportedOperationException Objects of this framework cannot be serialized
*/
public final function __wakeup () {
- throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+ throw new UnsupportedOperationException([$this, __FUNCTION__], self::EXCEPTION_UNSPPORTED_OPERATION);
}
/**
* @throws UnsupportedOperationException Objects of this framework cannot be serialized
*/
public final function __invoke () {
- throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+ throw new UnsupportedOperationException([$this, __FUNCTION__], self::EXCEPTION_UNSPPORTED_OPERATION);
}
/**
));
}
- /**
- * Replaces control characters with printable output
- *
- * @param $str String with control characters
- * @return $str Replaced string
- */
- protected function replaceControlCharacters (string $str) {
- // Replace them
- $str = str_replace(
- chr(13), '[r]', str_replace(
- chr(10), '[n]', str_replace(
- chr(9) , '[t]',
- $str
- )));
-
- // Return it
- return $str;
- }
-
/**
* Output a partial stub message for the caller method
*
$backtrace = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT);
// Is function partialStub/__callStatic ?
- if (in_array($backtrace[1]['function'], array('partialStub', '__call', '__callStatic'))) {
+ if (isset(self::$stubMethods[$backtrace[1]['function']])) {
// Prepend class::function:line from 3rd element
$message = sprintf('[%s::%s:%d]: %s',
$backtrace[2]['class'],
* @param $keyGroup Main group for the key
* @return $count Count of given group
*/
- protected final function countGenericArray ($keyGroup) {
+ protected final function countGenericArray (string $keyGroup) {
// Debug message
//* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
* @param $keyGroup Key group to get
* @return $array Whole generic array group
*/
- protected final function getGenericArray ($keyGroup) {
+ protected final function getGenericArray (string $keyGroup) {
// Debug message
//* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
* @return $translated Translated boolean value
*/
public static final function translateBooleanToYesNo (bool $boolean) {
- // Make sure it is really boolean
- assert(is_bool($boolean));
-
// "Translate" it
$translated = ($boolean === true) ? 'Y' : 'N';