@@ -59,7 +59,7 @@ |
||
59 | 59 | { |
60 | 60 | $host = $_SERVER['HTTP_HOST']; |
61 | 61 | $https = !empty($_SERVER['HTTPS']) ? 'https' : 'http'; |
62 | - return $https . '://' . $host . '/'; |
|
62 | + return $https.'://'.$host.'/'; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -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, |
@@ -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 | } |
@@ -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 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->devHelper(); |
124 | 124 | } |
125 | 125 | $twig = $this->container->getTemplate(); |
126 | - $twig->display($template . '.twig', $this->data); |
|
126 | + $twig->display($template.'.twig', $this->data); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | protected function devHelper($var = '') |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | default: |
24 | 24 | $headerType = 'text/html'; |
25 | 25 | } |
26 | - $contentType = 'Content-Type: ' . $headerType; |
|
26 | + $contentType = 'Content-Type: '.$headerType; |
|
27 | 27 | |
28 | 28 | header($contentType); |
29 | 29 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - header("location: /" . $url); |
|
44 | + header("location: /".$url); |
|
45 | 45 | die(); //after redirect do not execute anything else from the function |
46 | 46 | } |
47 | 47 | } |
48 | 48 | \ No newline at end of file |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $specialNamespace = array_shift($url); |
68 | 68 | |
69 | 69 | //making sure we have a single backslash |
70 | - $specialNamespace = rtrim($specialNamespace, '\\') . '\\'; |
|
70 | + $specialNamespace = rtrim($specialNamespace, '\\').'\\'; |
|
71 | 71 | |
72 | 72 | //capitalize the special namespace |
73 | 73 | $specialNamespace = $this->convertToStudlyCaps($specialNamespace); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | |
136 | 136 | //try to create the controller object |
137 | - $fullControllerName = $this->currentNamespace . $this->currentController; |
|
137 | + $fullControllerName = $this->currentNamespace.$this->currentController; |
|
138 | 138 | |
139 | 139 | //make sure the class exists before continuing |
140 | 140 | if (!class_exists($fullControllerName)) { |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | if ($table === null) { |
117 | 117 | $reflect = new \ReflectionClass(get_class($this)); |
118 | 118 | $table = $reflect->getShortName(); //this is to only get the model name, otherwise we get the full namespace |
119 | - $table = $table . 's'; //adding the s since the table should be plural. Might be some special case where the plural isn't just with an s |
|
119 | + $table = $table.'s'; //adding the s since the table should be plural. Might be some special case where the plural isn't just with an s |
|
120 | 120 | $table = strtolower($table); //the database names are in lowercase |
121 | 121 | } |
122 | 122 | |
123 | - if(Config::TABLE_PREFIX != '') |
|
123 | + if (Config::TABLE_PREFIX != '') |
|
124 | 124 | { |
125 | 125 | $table = Config::TABLE_PREFIX.'_'.$table; |
126 | 126 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | //if we are here, then table doesn't exist, check for view |
141 | - $view = 'v_' . $table; |
|
141 | + $view = 'v_'.$table; |
|
142 | 142 | $stmt->bindValue(':table', $view, PDO::PARAM_STR); |
143 | 143 | $stmt->execute(); |
144 | 144 | $exists = $stmt->rowCount() > 0; //will return 1 if table exists or 0 if non existant |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | protected function getRowById($rowId, $table = ''): array |
218 | 218 | { |
219 | 219 | $tableName = $this->getTable($table); |
220 | - $idName = 'id' . $tableName; |
|
220 | + $idName = 'id'.$tableName; |
|
221 | 221 | $sql = "SELECT * FROM $tableName WHERE $idName = :rowId"; |
222 | 222 | $this->query($sql); |
223 | 223 | $this->bind(':rowId', $rowId); |