diff --git a/src/FuzeWorks/Configurator.php b/src/FuzeWorks/Configurator.php index 42a74e0..f1dd8e4 100644 --- a/src/FuzeWorks/Configurator.php +++ b/src/FuzeWorks/Configurator.php @@ -364,6 +364,7 @@ class Configurator foreach ($deferredComponentClasses as $deferredComponentClass) { Logger::logDebug("Invoking '" . $deferredComponentClass->method . "' on component '" . $deferredComponentClass->componentClass . "'"); + /** @var DeferredComponentClass $deferredComponentClass */ $deferredComponentClass->invoke(call_user_func_array( array($container->{$deferredComponentClass->componentClass}, $deferredComponentClass->method), $deferredComponentClass->arguments diff --git a/src/FuzeWorks/Core.php b/src/FuzeWorks/Core.php index a3367ac..35116e7 100644 --- a/src/FuzeWorks/Core.php +++ b/src/FuzeWorks/Core.php @@ -35,8 +35,8 @@ */ namespace FuzeWorks; -use FuzeWorks\Exception\Exception; -use FuzeWorks\Exception\CoreException; + +use FuzeWorks\Exception\EventException; /** * FuzeWorks Core. @@ -109,6 +109,7 @@ class Core * Stop FuzeWorks and run all shutdown functions. * * Afterwards run the Logger shutdown function in order to possibly display the log + * @throws EventException */ public static function shutdown() { diff --git a/src/FuzeWorks/Event/NotifierEvent.php b/src/FuzeWorks/Event/NotifierEvent.php index 618968b..e910eb6 100644 --- a/src/FuzeWorks/Event/NotifierEvent.php +++ b/src/FuzeWorks/Event/NotifierEvent.php @@ -47,4 +47,3 @@ class NotifierEvent extends Event { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Event/PluginGetEvent.php b/src/FuzeWorks/Event/PluginGetEvent.php index 5ce4ef5..2b6e415 100644 --- a/src/FuzeWorks/Event/PluginGetEvent.php +++ b/src/FuzeWorks/Event/PluginGetEvent.php @@ -86,4 +86,3 @@ class PluginGetEvent extends Event } } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/ConfigException.php b/src/FuzeWorks/Exception/ConfigException.php index 94bd40a..36b0cb3 100644 --- a/src/FuzeWorks/Exception/ConfigException.php +++ b/src/FuzeWorks/Exception/ConfigException.php @@ -46,4 +46,3 @@ class ConfigException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/ConfiguratorException.php b/src/FuzeWorks/Exception/ConfiguratorException.php index f06c9e7..72025ee 100644 --- a/src/FuzeWorks/Exception/ConfiguratorException.php +++ b/src/FuzeWorks/Exception/ConfiguratorException.php @@ -46,4 +46,3 @@ class ConfiguratorException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/CoreException.php b/src/FuzeWorks/Exception/CoreException.php index b90fb08..1492f28 100644 --- a/src/FuzeWorks/Exception/CoreException.php +++ b/src/FuzeWorks/Exception/CoreException.php @@ -46,4 +46,3 @@ class CoreException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/EventException.php b/src/FuzeWorks/Exception/EventException.php index dee3276..8ef99fd 100644 --- a/src/FuzeWorks/Exception/EventException.php +++ b/src/FuzeWorks/Exception/EventException.php @@ -46,4 +46,3 @@ class EventException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/FactoryException.php b/src/FuzeWorks/Exception/FactoryException.php index 791d02a..7756d7e 100644 --- a/src/FuzeWorks/Exception/FactoryException.php +++ b/src/FuzeWorks/Exception/FactoryException.php @@ -46,4 +46,3 @@ class FactoryException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/HelperException.php b/src/FuzeWorks/Exception/HelperException.php index ee37973..7480c4c 100644 --- a/src/FuzeWorks/Exception/HelperException.php +++ b/src/FuzeWorks/Exception/HelperException.php @@ -46,4 +46,3 @@ class HelperException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/InvalidArgumentException.php b/src/FuzeWorks/Exception/InvalidArgumentException.php index 3cde023..8fff516 100644 --- a/src/FuzeWorks/Exception/InvalidArgumentException.php +++ b/src/FuzeWorks/Exception/InvalidArgumentException.php @@ -46,4 +46,3 @@ class InvalidArgumentException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/LibraryException.php b/src/FuzeWorks/Exception/LibraryException.php index fd8b5b2..77d25a8 100644 --- a/src/FuzeWorks/Exception/LibraryException.php +++ b/src/FuzeWorks/Exception/LibraryException.php @@ -46,4 +46,3 @@ class LibraryException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/LoggerException.php b/src/FuzeWorks/Exception/LoggerException.php index 0c3c3b3..18715ef 100644 --- a/src/FuzeWorks/Exception/LoggerException.php +++ b/src/FuzeWorks/Exception/LoggerException.php @@ -46,4 +46,3 @@ class LoggerException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Exception/PluginException.php b/src/FuzeWorks/Exception/PluginException.php index 55d41c4..1b366c0 100644 --- a/src/FuzeWorks/Exception/PluginException.php +++ b/src/FuzeWorks/Exception/PluginException.php @@ -46,4 +46,3 @@ class PluginException extends Exception { } -?> \ No newline at end of file diff --git a/src/FuzeWorks/Factory.php b/src/FuzeWorks/Factory.php index c0d69b4..7642d48 100644 --- a/src/FuzeWorks/Factory.php +++ b/src/FuzeWorks/Factory.php @@ -121,9 +121,10 @@ class Factory */ public $plugins; - /** - * Factory instance constructor. Should only really be called once - */ + /** + * Factory instance constructor. Should only really be called once + * @throws ConfigException + */ public function __construct() { // If there is no sharedFactoryInstance, prepare it diff --git a/src/FuzeWorks/Logger.php b/src/FuzeWorks/Logger.php index c5fa2f7..1cf6382 100644 --- a/src/FuzeWorks/Logger.php +++ b/src/FuzeWorks/Logger.php @@ -36,6 +36,7 @@ namespace FuzeWorks; +use FuzeWorks\Exception\ConfigException; use FuzeWorks\Exception\EventException; use FuzeWorks\Exception\Exception; @@ -104,6 +105,7 @@ class Logger { * Initiates the Logger. * * Registers the error and exception handler, when required to do so by configuration + * @throws ConfigException */ public function __construct() { @@ -119,15 +121,15 @@ class Logger { // @codeCoverageIgnoreEnd // Set PHP error reporting - if ($cfg_error->php_error_reporting) + if ($cfg_error->get('php_error_reporting')) error_reporting(true); else error_reporting(false); // Set the environment variables - self::$log_last_request = $cfg_error->log_last_request_to_file; - self::$log_errors_to_file = $cfg_error->log_errors_to_file; - self::$logger_template = $cfg_error->logger_template; + self::$log_last_request = $cfg_error->get('log_last_request_to_file'); + self::$log_errors_to_file = $cfg_error->get('log_errors_to_file'); + self::$logger_template = $cfg_error->get('logger_template'); self::newLevel('Logger Initiated'); } @@ -185,6 +187,7 @@ class Logger { * @codeCoverageIgnore * * Logs data to screen when requested to do so + * @throws EventException */ public static function shutdown() { @@ -289,6 +292,7 @@ class Logger { /** * Output the entire log to the screen. Used for debugging problems with your code. * @codeCoverageIgnore + * @throws EventException */ public static function logToScreen() { diff --git a/src/FuzeWorks/Plugins.php b/src/FuzeWorks/Plugins.php index 2bf5029..0bb5dd1 100644 --- a/src/FuzeWorks/Plugins.php +++ b/src/FuzeWorks/Plugins.php @@ -37,6 +37,7 @@ namespace FuzeWorks; use FuzeWorks\ConfigORM\ConfigORM; use FuzeWorks\Event\PluginGetEvent; +use FuzeWorks\Exception\ConfigException; use FuzeWorks\Exception\PluginException; use ReflectionClass; use ReflectionException; @@ -90,12 +91,12 @@ class Plugins /** * Called upon creation of the plugins class. * - * @return void + * @throws ConfigException * @codeCoverageIgnore */ public function __construct() { - $this->cfg = Factory::getInstance()->config->plugins; + $this->cfg = Factory::getInstance()->config->getConfig('plugins'); } /** @@ -169,7 +170,7 @@ class Plugins $pluginName = ucfirst($header->getName()); // Check if the plugin is disabled - if (in_array($pluginName, $this->cfg->disabled_plugins)) + if (in_array($pluginName, $this->cfg->get('disabled_plugins'))) { $this->headers[$pluginName] = 'disabled'; return false; @@ -245,7 +246,7 @@ class Plugins } // If disabled, don't bother - if (in_array($pluginName, $this->cfg->disabled_plugins)) + if (in_array($pluginName, $this->cfg->get('disabled_plugins'))) { throw new PluginException("Could not load plugin. Plugin is disabled", 1); }