@@ -86,45 +86,45 @@ discard block |
||
86 | 86 | $childClassNamespace = new \ReflectionClass(get_class($this)); |
87 | 87 | $childClassNamespace = $childClassNamespace->getNamespaceName(); |
88 | 88 | //check in classNameSpace, make sure we are not already in App or core |
89 | - if (class_exists($childClassNamespace . '\\Modules\\' . $loadModule)) { |
|
90 | - if($childClassNamespace !== 'App\\Modules\\' || $childClassNamespace !== 'Core\\Modules\\'){ |
|
91 | - $loadModuleObj = $childClassNamespace . '\\' . $loadModule; |
|
89 | + if (class_exists($childClassNamespace.'\\Modules\\'.$loadModule)) { |
|
90 | + if ($childClassNamespace !== 'App\\Modules\\' || $childClassNamespace !== 'Core\\Modules\\') { |
|
91 | + $loadModuleObj = $childClassNamespace.'\\'.$loadModule; |
|
92 | 92 | $found = true; |
93 | 93 | } |
94 | 94 | } |
95 | 95 | //check in app |
96 | - if (class_exists('App\\Modules\\' . $loadModule)) { |
|
97 | - if($found && Config::DEV_ENVIRONMENT){ |
|
96 | + if (class_exists('App\\Modules\\'.$loadModule)) { |
|
97 | + if ($found && Config::DEV_ENVIRONMENT) { |
|
98 | 98 | $this->alertBox->setAlert($loadModule.' already defined in namespace', 'error'); |
99 | 99 | } |
100 | - if(!$found){ |
|
101 | - $loadModuleObj = 'App\\Modules\\' . $loadModule; |
|
100 | + if (!$found) { |
|
101 | + $loadModuleObj = 'App\\Modules\\'.$loadModule; |
|
102 | 102 | $found = true; |
103 | 103 | } |
104 | 104 | } |
105 | 105 | //check in core, send error popup if overcharged |
106 | - if (class_exists('Core\\Modules\\' . $loadModule)) { |
|
107 | - if($found && Config::DEV_ENVIRONMENT){ |
|
106 | + if (class_exists('Core\\Modules\\'.$loadModule)) { |
|
107 | + if ($found && Config::DEV_ENVIRONMENT) { |
|
108 | 108 | $this->alertBox->setAlert($loadModule.' already defined in app', 'error'); |
109 | 109 | } |
110 | - if(!$found){ |
|
111 | - $loadModuleObj = 'Core\\Modules\\' . $loadModule; |
|
110 | + if (!$found) { |
|
111 | + $loadModuleObj = 'Core\\Modules\\'.$loadModule; |
|
112 | 112 | $found = true; |
113 | 113 | } |
114 | 114 | } |
115 | - if(!$found) { |
|
116 | - throw new \ErrorException('module ' . $loadModule . ' does not exist'); |
|
115 | + if (!$found) { |
|
116 | + throw new \ErrorException('module '.$loadModule.' does not exist'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | //Modules must be children of the Module template |
120 | 120 | if (!is_subclass_of($loadModuleObj, 'Core\Modules\Module')) { |
121 | - throw new \ErrorException('Module ' . $loadModuleName . ' must be a sub class of module'); |
|
121 | + throw new \ErrorException('Module '.$loadModuleName.' must be a sub class of module'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $loadedModule = new $loadModuleObj($this->container); |
125 | 125 | //we are not allowed to create public modules, they must be a placeholder ready |
126 | 126 | if (!property_exists($this, $loadModuleName)) { |
127 | - throw new \ErrorException('the protected or private variable of ' . $loadModuleName . ' is not present'); |
|
127 | + throw new \ErrorException('the protected or private variable of '.$loadModuleName.' is not present'); |
|
128 | 128 | } |
129 | 129 | $this->$loadModuleName = $loadedModule; |
130 | 130 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | public function getView($template) |
151 | 151 | { |
152 | 152 | $twig = $this->container->getTemplate(); |
153 | - return $twig->render($template . '.twig', $this->data); |
|
153 | + return $twig->render($template.'.twig', $this->data); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->devHelper(); |
172 | 172 | } |
173 | 173 | $twig = $this->container->getTemplate(); |
174 | - $twig->display($template . '.twig', $this->data); |
|
174 | + $twig->display($template.'.twig', $this->data); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | protected function devHelper($var = '') |