* @param $message Optional message to show in debug output
* @return void
*/
- public final function debugInstance ($message = '') {
+ public final function debugInstance (string $message = '') {
// Restore the error handler to avoid trouble with missing array elements or undeclared variables
restore_error_handler();
* @param $str String with control characters
* @return $str Replaced string
*/
- protected function replaceControlCharacters ($str) {
+ protected function replaceControlCharacters (string $str) {
// Replace them
$str = str_replace(
chr(13), '[r]', str_replace(
* @param $message An optional message to display
* @return void
*/
- protected function partialStub ($message = '') {
+ protected function partialStub (string $message = '') {
// Init variable
$stubMessage = 'Partial stub!';
* @param $doExit Whether exit the program (true is default)
* @return void
*/
- public function debugBackTrace ($message = '', $doExit = true) {
+ public function debugBackTrace (string $message = '', bool $doExit = true) {
// Sorry, there is no other way getting this nice backtrace
if (!empty($message)) {
// Output message
* @return $debugInstance An instance of a debugger class
* @deprecated Not fully, as the new Logger facilities are not finished yet.
*/
- public final static function createDebugInstance ($className, $lineNumber = NULL) {
+ public final static function createDebugInstance (string $className, int $lineNumber = NULL) {
// Is the instance set?
if (!GenericRegistry::getRegistry()->instanceExists('debug')) {
// Init debug instance
* @param $message Message to output
* @return void
*/
- public function outputLine ($message) {
+ public function outputLine (string $message) {
// Simply output it
print($message . PHP_EOL);
}
* @paran $stripTags Whether to strip tags (default: false)
* @return void
*/
- public function debugOutput ($message, $doPrint = true, $stripTags = false) {
+ public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false) {
// Set debug instance to NULL
$debugInstance = NULL;
* @param $phpCode Unmarked PHP code
* @return $markedCode Marked PHP code
*/
- public function markupCode ($phpCode) {
+ public function markupCode (string $phpCode) {
// Init marked code
$markedCode = '';
* @return void
* @todo Write a logging mechanism for productive mode
*/
- public function deprecationWarning ($message) {
+ public function deprecationWarning (string $message) {
// Is developer mode active?
if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
// Debug instance is there?
* @param $phpExtension The PHP extension we shall check
* @return $isLoaded Whether the PHP extension is loaded
*/
- public final function isPhpExtensionLoaded ($phpExtension) {
+ public final function isPhpExtensionLoaded (string $phpExtension) {
// Is it loaded?
$isLoaded = in_array($phpExtension, get_loaded_extensions());
*
* @return $hasSlept Whether it goes fine
*/
- public function idle ($milliSeconds) {
+ public function idle (int $milliSeconds) {
// Sleep is fine by default
$hasSlept = true;
* @param $encodedData Encoded data we shall check
* @return $isBase64 Whether the encoded data is Base64
*/
- protected function isBase64Encoded ($encodedData) {
+ protected function isBase64Encoded (string $encodedData) {
// Determine it
$isBase64 = (@base64_decode($encodedData, true) !== false);
* @param $str The string to be hashed
* @return $hash The hash from string $str
*/
- public static final function hash ($str) {
+ public static final function hash (string $str) {
// Hash given string with (better secure) hasher
$hash = bin2hex(mhash(MHASH_SHA256, $str));