Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 11 Apr 2018 20:46:10 +0000 (22:46 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 11 Apr 2018 20:46:10 +0000 (22:46 +0200)
- no need to handle $applicationInstance around as it exists in GenericRegister
  already
- please update your index.php to this

Signed-off-by: Roland Häder <roland@mxchange.org>
25 files changed:
application/tests/class_ApplicationHelper.php
framework/main/classes/commands/class_BaseCommand.php
framework/main/classes/commands/html/class_HtmlConfirmCommand.php
framework/main/classes/commands/html/class_HtmlHomeCommand.php
framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php
framework/main/classes/commands/html/class_HtmlLoginCommand.php
framework/main/classes/commands/html/class_HtmlLoginFailedCommand.php
framework/main/classes/commands/html/class_HtmlLogoutDoneCommand.php
framework/main/classes/commands/html/class_HtmlRegisterCommand.php
framework/main/classes/commands/html/class_HtmlResendLinkCommand.php
framework/main/classes/commands/html/class_HtmlStatusCommand.php
framework/main/classes/decorator/template/class_XmlRewriterTemplateDecorator.php
framework/main/classes/mailer/debug/class_DebugMailer.php
framework/main/classes/resolver/action/html/class_HtmlActionResolver.php
framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php
framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php
framework/main/classes/resolver/command/image/class_ImageCommandResolver.php
framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php
framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php
framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php
framework/main/classes/template/class_BaseTemplateEngine.php
framework/main/interfaces/template/class_CompileableTemplate.php
framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php
framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php
index.php

index 007ed66..008bda1 100644 (file)
@@ -226,7 +226,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                                FrameworkBootstrap::getRequestTypeFromSystem()
                        ))
                );
-               $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
+               $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName));
 
                // Get a controller instance as well
                $this->setControllerInstance($resolverInstance->resolveController());
index 12ae369..d38a197 100644 (file)
@@ -62,7 +62,7 @@ abstract class BaseCommand extends BaseFrameworkSystem {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Transfer application data
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Assign base URL
                $templateInstance->assignConfigVariable('base_url');
index e6b3f81..5be6195 100644 (file)
@@ -79,7 +79,7 @@ class HtmlConfirmCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Assign application data with template engine
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Assign base URL
                $templateInstance->assignConfigVariable('base_url');
index ef2de9a..4ff2855 100644 (file)
@@ -77,7 +77,7 @@ class HtmlHomeCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Transfer application data
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
index 3437798..a7aad82 100644 (file)
@@ -107,7 +107,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $templateInstance->assignConfigVariable('base_url');
 
                // Assign all the application's data with template variables
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
@@ -196,11 +196,8 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
                        $this->actionName = self::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $actReq;
                } // END - if
 
-               // Get application instance
-               $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
-
                // Get a resolver
-               $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName, $applicationInstance);
+               $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName);
 
                // Resolve the action
                $actionInstance = $actionResolver->resolveAction();
index 4b5f017..aa0d9d8 100644 (file)
@@ -80,7 +80,7 @@ class HtmlLoginCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Assign application data with template engine
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Assign base URL
                $templateInstance->assignConfigVariable('base_url');
index 3b19b20..31f8bab 100644 (file)
@@ -77,7 +77,7 @@ class HtmlLoginFailedCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Assign application data with template engine
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
index 0ed6101..603974c 100644 (file)
@@ -77,7 +77,7 @@ class HtmlLogoutDoneCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Assign application data
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
index 98bd6ed..18e7155 100644 (file)
@@ -80,7 +80,7 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Assign all the application's data with template variables
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Assign base URL
                $templateInstance->assignConfigVariable('base_url');
index d0e558e..9148524 100644 (file)
@@ -99,10 +99,10 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Assign the application data with the template engine
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Get a mailer class
-               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, $applicationInstance, 'resend_link'));
+               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, 'resend_link'));
 
                // Set this mailer in our template engine
                $templateInstance->setMailerInstance($mailerInstance);
index 3bcadda..e6d4e39 100644 (file)
@@ -77,7 +77,7 @@ class HtmlStatusCommand extends BaseCommand implements Commandable {
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
 
                // Transfer application data
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
index 4325fff..e146731 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Template\Xml;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Generic\BaseDecorator;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
@@ -274,12 +273,11 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT
        /**
         * Assigns all the application data with template variables
         *
-        * @param       $applicationInstance    A manageable application instance
         * @return      void
         */
-       public function assignApplicationData (ManageableApplication $applicationInstance) {
+       public function assignApplicationData () {
                // Call the inner class' method
-               $this->getTemplateInstance()->assignApplicationData($applicationInstance);
+               $this->getTemplateInstance()->assignApplicationData();
        }
 
        /**
index 40b67c6..876f323 100644 (file)
@@ -8,7 +8,6 @@ use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Mailer\BaseMailer;
 use Org\Mxchange\CoreFramework\Mailer\DeliverableMail;
 use Org\Mxchange\CoreFramework\Manager\Login\ManageableMember;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
@@ -54,7 +53,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
         * @param       $templateName                   Name of email template to set
         * @return      $mailerInstance                 An instance of this mailer class
         */
-       public static final function createDebugMailer (CompileableTemplate $templateInstance, ManageableApplication $applicationInstance, $templateName) {
+       public static final function createDebugMailer (CompileableTemplate $templateInstance, $templateName) {
                // Get a new instance
                $mailerInstance = new DebugMailer();
 
index ee1d601..05b498d 100644 (file)
@@ -3,7 +3,6 @@
 namespace Org\Mxchange\CoreFramework\Resolver\Action;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 
 // Import SPL stuff
@@ -54,12 +53,11 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver {
         * Creates an instance of a Html action resolver with a given default action
         *
         * @param       $actionName                             The default action we shall execute
-        * @param       $applicationInstance    An instance of a manageable application helper class
         * @return      $resolverInstance               The prepared action resolver instance
         * @throws      InvalidArgumentException        Thrown if default action is not set
         * @throws      InvalidActionException  Thrown if default action is invalid
         */
-       public static final function createHtmlActionResolver ($actionName, ManageableApplication $applicationInstance) {
+       public static final function createHtmlActionResolver ($actionName) {
                // Create the new instance
                $resolverInstance = new HtmlActionResolver();
 
index 191f6d5..2fb6e0f 100644 (file)
@@ -5,7 +5,6 @@ namespace Org\Mxchange\CoreFramework\Resolver\Command;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 
 // Import SPL stuff
@@ -51,12 +50,11 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol
         * Creates an instance of a Console command resolver with a given default command
         *
         * @param       $commandName                            The default command we shall execute
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      InvalidArgumentException                Thrown if default command is not set
+        * @throws      InvalidArgumentException        Thrown if default command is not set
         * @throws      InvalidCommandException         Thrown if default command is invalid
         */
-       public static final function createConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+       public static final function createConsoleCommandResolver ($commandName) {
                // Create the new instance
                $resolverInstance = new ConsoleCommandResolver();
 
index 93c04fe..e73ddc0 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Resolver\Command;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 
 // Import SPL stuff
@@ -55,12 +54,11 @@ class HtmlCommandResolver extends BaseCommandResolver implements CommandResolver
         * Creates an instance of a Html command resolver with a given default command
         *
         * @param       $commandName                            The default command we shall execute
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
         * @throws      InvalidArgumentException        Thrown if default command is not set
         * @throws      InvalidCommandException         Thrown if default command is invalid
         */
-       public static final function createHtmlCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+       public static final function createHtmlCommandResolver ($commandName) {
                // Create the new instance
                $resolverInstance = new HtmlCommandResolver();
 
index a041d1d..6b1b449 100644 (file)
@@ -54,12 +54,11 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
         * Creates an instance of a Image command resolver with a given default command
         *
         * @param       $commandName                            The default command we shall execute
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
         * @throws      InvalidArgumentException                Thrown if default command is not set
         * @throws      InvalidCommandException         Thrown if default command is invalid
         */
-       public static final function createImageCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+       public static final function createImageCommandResolver ($commandName) {
                // Create the new instance
                $resolverInstance = new ImageCommandResolver();
 
index d8db5dc..eccd32d 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Resolver\Controller;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 
@@ -52,12 +51,11 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
         *
         * @param       $namespace                                      Namespace to look in
         * @param       $controllerName                         The controller we shall resolve
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      InvalidArgumentException                Thrown if default controller is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createConsoleControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) {
+       public static final function createConsoleControllerResolver ($namespace, $controllerName) {
                // Create the new instance
                $resolverInstance = new ConsoleControllerResolver();
 
index 1918950..ae556aa 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Resolver\Controller;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 
@@ -52,12 +51,11 @@ class HtmlControllerResolver extends BaseControllerResolver implements Controlle
         *
         * @param       $namespace                                      Namespace to look in
         * @param       $controllerName                         The controller we shall resolve
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      InvalidArgumentException                Thrown if default controller is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createHtmlControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) {
+       public static final function createHtmlControllerResolver ($namespace, $controllerName) {
                // Create the new instance
                $resolverInstance = new HtmlControllerResolver();
 
index 91ed2cc..ddd151b 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Resolver\Controller;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 
@@ -52,12 +51,11 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
         *
         * @param       $namespace                                      Namespace to look in
         * @param       $controllerName                         The controller we shall resolve
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      InvalidArgumentException                Thrown if default controller is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createImageControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) {
+       public static final function createImageControllerResolver ($namespace, $controllerName) {
                // Create the new instance
                $resolverInstance = new ImageControllerResolver();
 
index 01ff9a9..1908e3b 100644 (file)
@@ -9,6 +9,7 @@ use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
 // Import SPL stuff
@@ -1212,10 +1213,12 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
        /**
         * Assigns all the application data with template variables
         *
-        * @param       $applicationInstance    A manageable application instance
         * @return      void
         */
-       public function assignApplicationData (ManageableApplication $applicationInstance) {
+       public function assignApplicationData () {
+               // Get application instance
+               $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
+
                // Get long name and assign it
                $this->assignVariable('app_full_name' , $applicationInstance->getAppName());
 
index 480a25a..db9af6e 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Template;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
@@ -138,10 +137,9 @@ interface CompileableTemplate extends FrameworkInterface {
        /**
         * Assigns all the application data with template variables
         *
-        * @param       $applicationInstance    A manageable application instance
         * @return      void
         */
-       function assignApplicationData (ManageableApplication $applicationInstance);
+       function assignApplicationData ();
 
        /**
         * "Compiles" a variable by replacing {?var?} with it's content
index 9d61d50..925bb04 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Tests\Resolver\Command;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Command\BaseCommandResolver;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 
@@ -51,12 +50,11 @@ class TestsConsoleCommandResolver extends BaseCommandResolver implements Command
         * Creates an instance of a TestsConsole command resolver with a given default command
         *
         * @param       $commandName                            The default command we shall execute
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
         * @throws      InvalidArgumentException                Thrown if default command is not set
         * @throws      InvalidCommandException         Thrown if default command is invalid
         */
-       public static final function createTestsConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+       public static final function createTestsConsoleCommandResolver ($commandName) {
                // Create the new instance
                $resolverInstance = new TestsConsoleCommandResolver();
 
index 62c2540..ed861f3 100644 (file)
@@ -5,7 +5,6 @@ namespace Org\Mxchange\CoreFramework\Tests\Resolver\Controller;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
 use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 
@@ -52,12 +51,11 @@ class TestsConsoleControllerResolver extends BaseControllerResolver implements C
         * Creates an instance of a resolver class with a given command
         *
         * @param       $controllerName                         The controller we shall resolve
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      InvalidArgumentException                Thrown if default command is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createTestsConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+       public static final function createTestsConsoleControllerResolver ($controllerName) {
                // Create the new instance
                $resolverInstance = new TestsConsoleControllerResolver();
 
index 1e7f1d4..e3c5da8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -137,7 +137,7 @@ final class ApplicationEntryPoint {
                                $applicationInstance = ApplicationHelper::getSelfInstance();
 
                                // Assign application data
-                               $templateInstance->assignApplicationData($applicationInstance);
+                               $templateInstance->assignApplicationData();
                        } // END - if
 
                        // We only try this