@@ -102,7 +102,7 @@ |
||
| 102 | 102 | 500 => '500 Internal Server Error' |
| 103 | 103 | ); |
| 104 | 104 | // ok, validation error, or failure |
| 105 | - header('Status: ' . $status[$code]); |
|
| 105 | + header('Status: '.$status[$code]); |
|
| 106 | 106 | // return the encoded json |
| 107 | 107 | return json_encode(array( |
| 108 | 108 | 'status' => $code < 300, // success or not? |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | //make sure we have the right type or throw an error |
| 30 | 30 | |
| 31 | 31 | if (!in_array($type, $this->allowedTypes)) { |
| 32 | - throw new \Exception("Invalid toastr alert type " . $type); |
|
| 32 | + throw new \Exception("Invalid toastr alert type ".$type); |
|
| 33 | 33 | } |
| 34 | 34 | $message = [ |
| 35 | 35 | 'type' => $type, |
@@ -40,9 +40,9 @@ |
||
| 40 | 40 | $this->container->getResponse()->redirect(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - public function whoami(){ |
|
| 43 | + public function whoami() { |
|
| 44 | 44 | $userType = $this->auth->getUser(); |
| 45 | - if (is_null($userType)){ |
|
| 45 | + if (is_null($userType)) { |
|
| 46 | 46 | $userType = 'Not Set'; |
| 47 | 47 | } |
| 48 | 48 | $this->alertBox->setAlert($userType); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | } elseif ($this->auth->isUser()) { |
| 16 | 16 | $this->data['userRole'] = 'User'; |
| 17 | 17 | $this->data['userLevel'] = $this->auth->getUserLevel(); |
| 18 | - }else { |
|
| 18 | + } else { |
|
| 19 | 19 | $this->alertBox->setAlert("You must be connected to acces the admin interface", 'warning'); |
| 20 | 20 | $this->container->getResponse()->redirect(); |
| 21 | 21 | } |
@@ -35,9 +35,9 @@ |
||
| 35 | 35 | public function redirect(string $url = ''): void |
| 36 | 36 | { |
| 37 | 37 | //if the url was passed with a forward slash, remove it as it will be added later. |
| 38 | - if($url !== ''){ |
|
| 39 | - if($url[0]==='/'){ |
|
| 40 | - $url=substr($url, 1); |
|
| 38 | + if ($url !== '') { |
|
| 39 | + if ($url[0] === '/') { |
|
| 40 | + $url = substr($url, 1); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | //We load all our module objects into our object |
| 62 | 62 | foreach ($this->loadModules as $loadModule) { |
| 63 | - $loadModuleObj = 'Core\\Modules\\' . $loadModule; |
|
| 63 | + $loadModuleObj = 'Core\\Modules\\'.$loadModule; |
|
| 64 | 64 | |
| 65 | 65 | $loadModuleName = lcfirst($loadModule); |
| 66 | 66 | $loadedModule = new $loadModuleObj($this->container); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | //we are not allowed to create public modules, they must be a placeholder ready |
| 73 | 73 | if (!property_exists($this, $loadModuleName)) { |
| 74 | - throw new \ErrorException('class var ' . $loadModuleName . ' not present'); |
|
| 74 | + throw new \ErrorException('class var '.$loadModuleName.' not present'); |
|
| 75 | 75 | } |
| 76 | 76 | $this->$loadModuleName = $loadedModule; |
| 77 | 77 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public function getView($template) |
| 103 | 103 | { |
| 104 | 104 | $twig = $this->container->getTemplate(); |
| 105 | - return $twig->render($template . '.twig', $this->data); |
|
| 105 | + return $twig->render($template.'.twig', $this->data); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | if ($this->alertBox->alertsPending()) { |
| 120 | 120 | $this->data['alert_messages'] = $this->alertBox->getAlerts(); |
| 121 | 121 | } |
| 122 | - if(Config::DEV_ENVIRONMENT){ |
|
| 122 | + if (Config::DEV_ENVIRONMENT) { |
|
| 123 | 123 | $this->data['dev'] = true; |
| 124 | 124 | $this->data['class_object_methods'] = get_class_methods(get_class($this)); |
| 125 | 125 | $this->data['class_object_vars'] = get_object_vars($this); |
| 126 | 126 | } |
| 127 | 127 | $twig = $this->container->getTemplate(); |
| 128 | - $twig->display($template . '.twig', $this->data); |
|
| 128 | + $twig->display($template.'.twig', $this->data); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | \ No newline at end of file |