Removed void return type, since this is not officially supported.

This commit is contained in:
Abel Hoogeveen 2017-12-22 00:06:01 +01:00
parent d0f50af0eb
commit f5a4c9b7f4
19 changed files with 61 additions and 61 deletions

View File

@ -144,7 +144,7 @@ class Config
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function addConfigPath($directory): void public function addConfigPath($directory)
{ {
if (!in_array($directory, $this->configPaths)) if (!in_array($directory, $this->configPaths))
{ {
@ -158,7 +158,7 @@ class Config
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function removeConfigPath($directory): void public function removeConfigPath($directory)
{ {
if (($key = array_search($directory, $this->configPaths)) !== false) if (($key = array_search($directory, $this->configPaths)) !== false)
{ {

View File

@ -127,7 +127,7 @@ class Core
* *
* Afterwards run the Logger shutdown function in order to possibly display the log * Afterwards run the Logger shutdown function in order to possibly display the log
*/ */
public static function shutdown(): void public static function shutdown()
{ {
// Fix Apache bug where CWD is changed upon shutdown // Fix Apache bug where CWD is changed upon shutdown
chdir(self::$cwd); chdir(self::$cwd);
@ -245,7 +245,7 @@ class Core
* @param string * @param string
* @return void * @return void
*/ */
public static function setStatusHeader($code = 200, $text = ''): void public static function setStatusHeader($code = 200, $text = '')
{ {
if (self::isCli()) if (self::isCli())
{ {

View File

@ -51,14 +51,14 @@ class DatabaseTracyBridge implements IBarPanel
public static $databases = array(); public static $databases = array();
protected $results = array(); protected $results = array();
public static function register(): void public static function register()
{ {
$class = new self(); $class = new self();
$bar = Debugger::getBar(); $bar = Debugger::getBar();
$bar->addPanel($class); $bar->addPanel($class);
} }
public static function registerDatabase($database): void public static function registerDatabase($database)
{ {
self::$databases[] = $database; self::$databases[] = $database;
} }

View File

@ -55,7 +55,7 @@ class Event
/** /**
* @param bool $cancelled True if the event is cancelled, false if the event is not cancelled * @param bool $cancelled True if the event is cancelled, false if the event is not cancelled
*/ */
public function setCancelled($cancelled): void public function setCancelled($cancelled)
{ {
if ($cancelled == true) { if ($cancelled == true) {
$this->cancelled = true; $this->cancelled = true;

View File

@ -81,7 +81,7 @@ class Events
* *
* @throws EventException * @throws EventException
*/ */
public static function addListener($callback, $eventName, $priority = EventPriority::NORMAL): void public static function addListener($callback, $eventName, $priority = EventPriority::NORMAL)
{ {
// Perform multiple checks // Perform multiple checks
if (EventPriority::getPriority($priority) == false) { if (EventPriority::getPriority($priority) == false) {
@ -120,7 +120,7 @@ class Events
* *
* @throws EventException * @throws EventException
*/ */
public static function removeListener($callback, $eventName, $priority = EventPriority::NORMAL): void public static function removeListener($callback, $eventName, $priority = EventPriority::NORMAL)
{ {
if (EventPriority::getPriority($priority) == false) { if (EventPriority::getPriority($priority) == false) {
throw new EventException('Unknown priority '.$priority); throw new EventException('Unknown priority '.$priority);
@ -250,7 +250,7 @@ class Events
/** /**
* Enables the event system. * Enables the event system.
*/ */
public static function enable(): void public static function enable()
{ {
Logger::log('Enabled the Event system'); Logger::log('Enabled the Event system');
self::$enabled = true; self::$enabled = true;
@ -259,7 +259,7 @@ class Events
/** /**
* Disables the event system. * Disables the event system.
*/ */
public static function disable(): void public static function disable()
{ {
Logger::log('Disabled the Event system'); Logger::log('Disabled the Event system');
self::$enabled = false; self::$enabled = false;

View File

@ -223,7 +223,7 @@ class Factory
* *
* @return void * @return void
*/ */
public static function enableCloneInstances(): void public static function enableCloneInstances()
{ {
self::$cloneInstances = true; self::$cloneInstances = true;
} }
@ -233,7 +233,7 @@ class Factory
* *
* @return void * @return void
*/ */
public static function disableCloneInstances(): void public static function disableCloneInstances()
{ {
self::$cloneInstances = false; self::$cloneInstances = false;
} }

View File

@ -49,7 +49,7 @@ class GitTracyBridge implements IBarPanel {
/** /**
* Register the bar * Register the bar
*/ */
public static function register(): void public static function register()
{ {
$class = new self(); $class = new self();
$bar = Debugger::getBar(); $bar = Debugger::getBar();

View File

@ -185,7 +185,7 @@ class Helpers
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function addHelperPath($directory): void public function addHelperPath($directory)
{ {
if (!in_array($directory, $this->helperPaths)) if (!in_array($directory, $this->helperPaths))
{ {
@ -199,7 +199,7 @@ class Helpers
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function removeHelperPath($directory): void public function removeHelperPath($directory)
{ {
if (($key = array_search($directory, $this->helperPaths)) !== false) if (($key = array_search($directory, $this->helperPaths)) !== false)
{ {

View File

@ -349,7 +349,7 @@ class Input {
* @param bool $httponly Whether to only makes the cookie accessible via HTTP (no javascript) * @param bool $httponly Whether to only makes the cookie accessible via HTTP (no javascript)
* @return void * @return void
*/ */
public function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE): void public function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE)
{ {
if (is_array($name)) if (is_array($name))
{ {
@ -592,7 +592,7 @@ class Input {
* *
* @return void * @return void
*/ */
protected function _sanitize_globals(): void protected function _sanitize_globals()
{ {
// Is $_GET data allowed? If not we'll set the $_GET to an empty array // Is $_GET data allowed? If not we'll set the $_GET to an empty array
if ($this->_allow_get_array === FALSE) if ($this->_allow_get_array === FALSE)

View File

@ -77,7 +77,7 @@ class Language
*/ */
protected static $is_loaded = array(); protected static $is_loaded = array();
public static function init(): void public static function init()
{ {
self::$languagePaths[] = Core::$appDir . DS . 'Language'; self::$languagePaths[] = Core::$appDir . DS . 'Language';
} }

View File

@ -92,7 +92,7 @@ class Layout
*/ */
private $current_engine; private $current_engine;
public function init(): void public function init()
{ {
$this->directory = Core::$appDir . DS .'Layout'; $this->directory = Core::$appDir . DS .'Layout';
} }
@ -111,7 +111,7 @@ class Layout
* *
* @throws LayoutException On error * @throws LayoutException On error
*/ */
public function display($file, $directory = null, $directOutput = false): void public function display($file, $directory = null, $directOutput = false)
{ {
$output = Factory::getInstance()->output; $output = Factory::getInstance()->output;
$directory = (is_null($directory) ? $this->directory : $directory); $directory = (is_null($directory) ? $this->directory : $directory);
@ -305,7 +305,7 @@ class Layout
* @return string Filepath of the template * @return string Filepath of the template
* @throws LayoutException On error * @throws LayoutException On error
*/ */
public function setFileFromString($string, $directory, $extensions = array()): void public function setFileFromString($string, $directory, $extensions = array())
{ {
$this->file = $this->getFileFromString($string, $directory, $extensions); $this->file = $this->getFileFromString($string, $directory, $extensions);
$this->directory = preg_replace('#/+#', '/', (!is_null($directory) ? $directory : $this->directory).DS); $this->directory = preg_replace('#/+#', '/', (!is_null($directory) ? $directory : $this->directory).DS);
@ -346,7 +346,7 @@ class Layout
* *
* @param string $directory Path to the directory * @param string $directory Path to the directory
*/ */
public function setDirectory($directory): void public function setDirectory($directory)
{ {
$this->directory = $directory; $this->directory = $directory;
} }
@ -357,7 +357,7 @@ class Layout
* @param string $key Key of the variable * @param string $key Key of the variable
* @param mixed $value Value of the variable * @param mixed $value Value of the variable
*/ */
public function assign($key, $value): void public function assign($key, $value)
{ {
$this->assigned_variables[$key] = $value; $this->assigned_variables[$key] = $value;
} }
@ -367,7 +367,7 @@ class Layout
* *
* @param string $title title of the template * @param string $title title of the template
*/ */
public function setTitle($title): void public function setTitle($title)
{ {
$this->assigned_variables['title'] = $title; $this->assigned_variables['title'] = $title;
} }
@ -471,7 +471,7 @@ class Layout
/** /**
* Load the template engines by sending a layoutLoadEngineEvent. * Load the template engines by sending a layoutLoadEngineEvent.
*/ */
public function loadTemplateEngines(): void public function loadTemplateEngines()
{ {
if (!$this->engines_loaded) { if (!$this->engines_loaded) {
Events::fireEvent('layoutLoadEngineEvent'); Events::fireEvent('layoutLoadEngineEvent');
@ -508,7 +508,7 @@ class Layout
/** /**
* Resets the layout manager to its default state. * Resets the layout manager to its default state.
*/ */
public function reset(): void public function reset()
{ {
if (!is_null($this->current_engine)) { if (!is_null($this->current_engine)) {
$this->current_engine->reset(); $this->current_engine->reset();

View File

@ -428,7 +428,7 @@ class Libraries
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function addLibraryPath($directory): void public function addLibraryPath($directory)
{ {
if (!in_array($directory, $this->libraryPaths)) if (!in_array($directory, $this->libraryPaths))
{ {
@ -442,7 +442,7 @@ class Libraries
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function removeLibraryPath($directory): void public function removeLibraryPath($directory)
{ {
if (($key = array_search($directory, $this->libraryPaths)) !== false) if (($key = array_search($directory, $this->libraryPaths)) !== false)
{ {

View File

@ -33,7 +33,7 @@
namespace FuzeWorks; namespace FuzeWorks;
use FuzeWorks\Exception\Exception; use FuzeWorks\Exception\Exception;
use FuzeWorks\Exception\LayoutException; use FuzeWorks\Exception\LayoutException;
/** /**
@ -133,7 +133,7 @@ class Logger {
* *
* Logs data to screen when requested to do so * Logs data to screen when requested to do so
*/ */
public static function shutdown(): void public static function shutdown()
{ {
// And finally stop the Logging // And finally stop the Logging
self::stopLevel(); self::stopLevel();
@ -156,7 +156,7 @@ class Logger {
* *
* Logs a fatal error and outputs the log when configured or requested to do so * Logs a fatal error and outputs the log when configured or requested to do so
*/ */
public static function shutdownError(): void public static function shutdownError()
{ {
// Load last error if thrown // Load last error if thrown
$errfile = 'Unknown file'; $errfile = 'Unknown file';
@ -192,7 +192,7 @@ class Logger {
* @param int Line. The line on which the error occured. * @param int Line. The line on which the error occured.
* @param array context. Some of the error's relevant variables * @param array context. Some of the error's relevant variables
*/ */
public static function errorHandler($type = E_USER_NOTICE, $error = 'Undefined Error', $errFile = null, $errLine = null, $context = null): void public static function errorHandler($type = E_USER_NOTICE, $error = 'Undefined Error', $errFile = null, $errLine = null, $context = null)
{ {
// Check type // Check type
$thisType = self::getType($type); $thisType = self::getType($type);
@ -212,7 +212,7 @@ class Logger {
* *
* @param Exception $exception The occured exception. * @param Exception $exception The occured exception.
*/ */
public static function exceptionHandler($exception): void public static function exceptionHandler($exception)
{ {
$message = $exception->getMessage(); $message = $exception->getMessage();
$code = $exception->getCode(); $code = $exception->getCode();
@ -233,7 +233,7 @@ class Logger {
* *
* @var string Name of the template file * @var string Name of the template file
*/ */
public static function setLoggerTemplate($templateName): void public static function setLoggerTemplate($templateName)
{ {
self::$logger_template = $templateName; self::$logger_template = $templateName;
} }
@ -258,7 +258,7 @@ class Logger {
* Output the entire log to a file. Used for debugging problems with your code. * Output the entire log to a file. Used for debugging problems with your code.
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
public static function logToFile(): void public static function logToFile()
{ {
ob_start(function () {}); ob_start(function () {});
$logs = self::$Logs; $logs = self::$Logs;
@ -282,7 +282,7 @@ class Logger {
* @param string $name Marker name * @param string $name Marker name
* @return void * @return void
*/ */
public static function mark($name): void public static function mark($name)
{ {
$LOG = array('type' => 'BMARK', $LOG = array('type' => 'BMARK',
'message' => (!is_null($name) ? $name : ''), 'message' => (!is_null($name) ? $name : ''),
@ -302,7 +302,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function log($msg, $mod = null, $file = 0, $line = 0): void public static function log($msg, $mod = null, $file = 0, $line = 0)
{ {
self::logInfo($msg, $mod, $file, $line); self::logInfo($msg, $mod, $file, $line);
} }
@ -315,7 +315,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function logInfo($msg, $mod = null, $file = 0, $line = 0): void public static function logInfo($msg, $mod = null, $file = 0, $line = 0)
{ {
$LOG = array('type' => 'INFO', $LOG = array('type' => 'INFO',
'message' => (!is_null($msg) ? $msg : ''), 'message' => (!is_null($msg) ? $msg : ''),
@ -335,7 +335,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function logDebug($msg, $mod = null, $file = 0, $line = 0): void public static function logDebug($msg, $mod = null, $file = 0, $line = 0)
{ {
$LOG = array('type' => 'DEBUG', $LOG = array('type' => 'DEBUG',
'message' => (!is_null($msg) ? $msg : ''), 'message' => (!is_null($msg) ? $msg : ''),
@ -355,7 +355,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function logError($msg, $mod = null, $file = 0, $line = 0): void public static function logError($msg, $mod = null, $file = 0, $line = 0)
{ {
$LOG = array('type' => 'ERROR', $LOG = array('type' => 'ERROR',
'message' => (!is_null($msg) ? $msg : ''), 'message' => (!is_null($msg) ? $msg : ''),
@ -375,7 +375,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function logWarning($msg, $mod = null, $file = 0, $line = 0): void public static function logWarning($msg, $mod = null, $file = 0, $line = 0)
{ {
$LOG = array('type' => 'WARNING', $LOG = array('type' => 'WARNING',
'message' => (!is_null($msg) ? $msg : ''), 'message' => (!is_null($msg) ? $msg : ''),
@ -395,7 +395,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function newLevel($msg, $mod = null, $file = null, $line = null): void public static function newLevel($msg, $mod = null, $file = null, $line = null)
{ {
$LOG = array('type' => 'LEVEL_START', $LOG = array('type' => 'LEVEL_START',
'message' => (!is_null($msg) ? $msg : ''), 'message' => (!is_null($msg) ? $msg : ''),
@ -415,7 +415,7 @@ class Logger {
* @param string $file The file where the log occured * @param string $file The file where the log occured
* @param int $line The line where the log occured * @param int $line The line where the log occured
*/ */
public static function stopLevel($msg = null, $mod = null, $file = null, $line = null): void public static function stopLevel($msg = null, $mod = null, $file = null, $line = null)
{ {
$LOG = array('type' => 'LEVEL_STOP', $LOG = array('type' => 'LEVEL_STOP',
'message' => (!is_null($msg) ? $msg : ''), 'message' => (!is_null($msg) ? $msg : ''),
@ -548,7 +548,7 @@ class Logger {
/** /**
* Enable error to screen logging. * Enable error to screen logging.
*/ */
public static function enable(): void public static function enable()
{ {
self::$print_to_screen = true; self::$print_to_screen = true;
} }
@ -556,7 +556,7 @@ class Logger {
/** /**
* Disable error to screen logging. * Disable error to screen logging.
*/ */
public static function disable(): void public static function disable()
{ {
self::$print_to_screen = false; self::$print_to_screen = false;
} }

View File

@ -50,7 +50,7 @@ class LoggerTracyBridge implements IBarPanel {
/** /**
* Register the bar and register the event which will block the screen log * Register the bar and register the event which will block the screen log
*/ */
public static function register(): void public static function register()
{ {
$class = new self(); $class = new self();
Events::addListener(array($class, 'screenLogEventListener'), 'screenLogEvent', EventPriority::NORMAL); Events::addListener(array($class, 'screenLogEventListener'), 'screenLogEvent', EventPriority::NORMAL);

View File

@ -166,7 +166,7 @@ class Models
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function addModelPath($directory): void public function addModelPath($directory)
{ {
if (!in_array($directory, $this->ModelPaths)) if (!in_array($directory, $this->ModelPaths))
{ {
@ -180,7 +180,7 @@ class Models
* @param string $directory The directory * @param string $directory The directory
* @return void * @return void
*/ */
public function removeModelPath($directory): void public function removeModelPath($directory)
{ {
if (($key = array_search($directory, $this->modelPaths)) !== false) if (($key = array_search($directory, $this->modelPaths)) !== false)
{ {

View File

@ -406,7 +406,7 @@ class Output {
* @param string $output Output data override * @param string $output Output data override
* @return void * @return void
*/ */
public function _display($output = ''): void public function _display($output = '')
{ {
$router = $this->factory->router; $router = $this->factory->router;
// Grab the super object if we can. // Grab the super object if we can.
@ -527,7 +527,7 @@ class Output {
* @param string $output Output data to cache * @param string $output Output data to cache
* @return void * @return void
*/ */
public function _write_cache($output): void public function _write_cache($output)
{ {
$cache_path = Core::$tempDir . DS . 'Output' . DS; $cache_path = Core::$tempDir . DS . 'Output' . DS;
@ -770,7 +770,7 @@ class Output {
* @param int $expiration Timestamp of when should the requested page expire from cache * @param int $expiration Timestamp of when should the requested page expire from cache
* @return void * @return void
*/ */
public function set_cache_header($last_modified, $expiration): void public function set_cache_header($last_modified, $expiration)
{ {
$max_age = $expiration - $_SERVER['REQUEST_TIME']; $max_age = $expiration - $_SERVER['REQUEST_TIME'];

View File

@ -175,7 +175,7 @@ class Router
* *
* @return void * @return void
*/ */
protected function parseRouting(): void protected function parseRouting()
{ {
// Get routing routes // Get routing routes
$routes = $this->config->routes; $routes = $this->config->routes;
@ -257,7 +257,7 @@ class Router
* @param bool $prepend Whether or not to insert at the beginning of the routing table * @param bool $prepend Whether or not to insert at the beginning of the routing table
* @return void * @return void
*/ */
public function addRoute($route, $callable, $prepend = true): void public function addRoute($route, $callable, $prepend = true)
{ {
if ($prepend) { if ($prepend) {
$this->routes = array($route => $callable) + $this->routes; $this->routes = array($route => $callable) + $this->routes;
@ -273,7 +273,7 @@ class Router
* *
* @param $route string The route to remove * @param $route string The route to remove
*/ */
public function removeRoute($route): void public function removeRoute($route)
{ {
unset($this->routes[$route]); unset($this->routes[$route]);
@ -374,7 +374,7 @@ class Router
* @param string @route The route which was matched * @param string @route The route which was matched
* @return void * @return void
*/ */
protected function routeDefault($segments = array(), $route): void protected function routeDefault($segments = array(), $route)
{ {
// If we don't have any segments left - try the default controller; // If we don't have any segments left - try the default controller;
// WARNING: Directories get shifted out of the segments array! // WARNING: Directories get shifted out of the segments array!
@ -485,7 +485,7 @@ class Router
* This callable will do the 'old skool' routing. It will load the controllers from the controller-directory * This callable will do the 'old skool' routing. It will load the controllers from the controller-directory
* in the application-directory. * in the application-directory.
*/ */
public function defaultCallable($arguments = array()): void public function defaultCallable($arguments = array())
{ {
$this->logger->log('Default callable called!'); $this->logger->log('Default callable called!');

View File

@ -31,7 +31,7 @@
*/ */
namespace FuzeWorks; namespace FuzeWorks;
use FuzeWorks\ConfigORM\ConfigORM; use FuzeWorks\ConfigORM\ConfigORM;
use FuzeWorks\Exception\{SecurityException,Exception}; use FuzeWorks\Exception\{SecurityException,Exception};
/** /**
@ -288,7 +288,7 @@ class Security {
* *
* @return void * @return void
*/ */
public function csrf_show_error(): void public function csrf_show_error()
{ {
throw new SecurityException('The action you have requested is not allowed.', 1); throw new SecurityException('The action you have requested is not allowed.', 1);
} }

View File

@ -31,7 +31,7 @@
*/ */
namespace FuzeWorks; namespace FuzeWorks;
use FuzeWorks\ConfigORM\ConfigORM; use FuzeWorks\ConfigORM\ConfigORM;
use FuzeWorks\Exception\UriException; use FuzeWorks\Exception\UriException;
/** /**
@ -167,7 +167,7 @@ class URI {
* @param string $str * @param string $str
* @return void * @return void
*/ */
protected function _set_uri_string($str, $is_cli = FALSE): void protected function _set_uri_string($str, $is_cli = FALSE)
{ {
if ($is_cli) if ($is_cli)
{ {