Passed
Push — Accessing-and-setting-the-site... ( ba0505...e712c3 )
by Stone
01:56
created
Core/Controller.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -84,25 +84,25 @@  discard block
 block discarded – undo
84 84
         //checking for module in namespace, app and core.
85 85
         $childClassNamespace = new \ReflectionClass(get_class($this));
86 86
         $childClassNamespace = $childClassNamespace->getNamespaceName();
87
-        if (class_exists($childClassNamespace . '\\Modules\\' . $loadModule)) {
88
-            $loadModuleObj = $childClassNamespace . '\\' . $loadModule;
89
-        } elseif (class_exists('App\\Modules\\' . $loadModule)) {
90
-            $loadModuleObj = 'App\\Modules\\' . $loadModule;
91
-        } elseif (class_exists('Core\\Modules\\' . $loadModule)) {
92
-            $loadModuleObj = 'Core\\Modules\\' . $loadModule;
93
-        } else {
94
-            throw new \ErrorException('module ' . $loadModule . ' does not exist');
87
+        if (class_exists($childClassNamespace.'\\Modules\\'.$loadModule)) {
88
+            $loadModuleObj = $childClassNamespace.'\\'.$loadModule;
89
+        } elseif (class_exists('App\\Modules\\'.$loadModule)) {
90
+            $loadModuleObj = 'App\\Modules\\'.$loadModule;
91
+        } elseif (class_exists('Core\\Modules\\'.$loadModule)) {
92
+            $loadModuleObj = 'Core\\Modules\\'.$loadModule;
93
+        }else {
94
+            throw new \ErrorException('module '.$loadModule.' does not exist');
95 95
         }
96 96
 
97 97
         //Modules must be children of the Module template
98 98
         if (!is_subclass_of($loadModuleObj, 'Core\Modules\Module')) {
99
-            throw new \ErrorException('Module ' . $loadModuleName . ' must be a sub class of module');
99
+            throw new \ErrorException('Module '.$loadModuleName.' must be a sub class of module');
100 100
         }
101 101
 
102 102
         $loadedModule = new $loadModuleObj($this->container);
103 103
         //we are not allowed to create public modules, they must be a placeholder ready
104 104
         if (!property_exists($this, $loadModuleName)) {
105
-            throw new \ErrorException('the protected or private variable of ' . $loadModuleName . ' is not present');
105
+            throw new \ErrorException('the protected or private variable of '.$loadModuleName.' is not present');
106 106
         }
107 107
         $this->$loadModuleName = $loadedModule;
108 108
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     public function getView($template)
129 129
     {
130 130
         $twig = $this->container->getTemplate();
131
-        return $twig->render($template . '.twig', $this->data);
131
+        return $twig->render($template.'.twig', $this->data);
132 132
     }
133 133
 
134 134
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             $this->devHelper();
150 150
         }
151 151
         $twig = $this->container->getTemplate();
152
-        $twig->display($template . '.twig', $this->data);
152
+        $twig->display($template.'.twig', $this->data);
153 153
     }
154 154
 
155 155
     protected function devHelper($var = '')
Please login to merge, or discard this patch.