Completed
Push — master ( a1c094...c4d7a3 )
by Marcus
04:19
created
src/Router.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
             $aPath = explode('/', $this->sPath);
88 88
             if (!empty($map[$this->sPath])) {
89
-                $class = '\\HaaseIT\\HCSF\\Controller\\' . $map[$this->sPath];
89
+                $class = '\\HaaseIT\\HCSF\\Controller\\'.$map[$this->sPath];
90 90
             } else {
91 91
                 if ($aPath[1] == HelperConfig::$core['directory_images']) {
92 92
                     $class = '\\HaaseIT\\HCSF\\Controller\\Glide';
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 } else { // if it is found, go on
129 129
                     // Support for shorturls
130 130
                     if ($this->P->cb_pagetype == 'shorturl') {
131
-                        header('Location: ' . $this->P->cb_pageconfig, true, 302);
131
+                        header('Location: '.$this->P->cb_pageconfig, true, 302);
132 132
                         exit();
133 133
                     }
134 134
 
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
                 $this->P->iStatus = 404;
146 146
 
147 147
                 $this->P->oPayload->cl_html = $this->serviceManager->get('textcats')->T("misc_page_not_found");
148
-                header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
148
+                header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
149 149
             } elseif (!is_object($this->P) && $this->P == 500) {
150 150
                 $this->P = new CorePage($this->serviceManager);
151 151
                 $this->P->cb_pagetype = 'error';
152 152
                 $this->P->iStatus = 500;
153 153
 
154 154
                 $this->P->oPayload->cl_html = $this->serviceManager->get('textcats')->T("misc_server_error");
155
-                header($_SERVER["SERVER_PROTOCOL"] . " 500 Internal Server Error");
155
+                header($_SERVER["SERVER_PROTOCOL"]." 500 Internal Server Error");
156 156
             } elseif (is_object($this->P) && $this->P->oPayload == NULL) {// elseif the page has been found but contains no payload...
157 157
                 if (
158 158
                     !(
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
                     )
163 163
                 ) { // no payload is fine if page is one of these
164 164
                     $this->P->oPayload->cl_html = $this->serviceManager->get('textcats')->T("misc_content_not_found");
165
-                    header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
165
+                    header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
166 166
                 }
167 167
             } elseif ($this->P->oPayload->cl_lang != NULL && $this->P->oPayload->cl_lang != HelperConfig::$lang) { // if the page is available but not in the current language, display info
168
-                $this->P->oPayload->cl_html = $this->serviceManager->get('textcats')->T("misc_page_not_available_lang") . '<br><br>' . $this->P->oPayload->cl_html;
168
+                $this->P->oPayload->cl_html = $this->serviceManager->get('textcats')->T("misc_page_not_available_lang").'<br><br>'.$this->P->oPayload->cl_html;
169 169
             }
170 170
         }
171 171
         return $this->P;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 // to allow dots in the filename, we have to iterate through all parts of the filename
188 188
                 $aRoutingoverride["itemno"] = '';
189 189
                 for ($i = 0; $i < count($aTMP["exploded_request_file"]) - 1; $i++) {
190
-                    $aRoutingoverride["itemno"] .= $aTMP["exploded_request_file"][$i] . '.';
190
+                    $aRoutingoverride["itemno"] .= $aTMP["exploded_request_file"][$i].'.';
191 191
                 }
192 192
                 // remove the trailing dot
193 193
                 $aRoutingoverride["itemno"] = \HaaseIT\Toolbox\Tools::cutStringend($aRoutingoverride["itemno"], 1);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 // rebuild the path string without the trailing '/item/itemno.html'
198 198
                 $this->sPath = '';
199 199
                 for ($i = 0; $i < $aTMP["parts_in_path"] - 2; $i++) {
200
-                    $this->sPath .= $aPath[$i] . '/';
200
+                    $this->sPath .= $aPath[$i].'/';
201 201
                 }
202 202
             }
203 203
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,9 +116,13 @@
 block discarded – undo
116 116
                     If the last part of the path doesn't include a dot (.) and is not empty, apend a slash.
117 117
                     If there is already a slash at the end, the last part of the path array will be empty.
118 118
                      */
119
-                    if (mb_strpos($aPath[count($aPath) - 1], '.') === false && $aPath[count($aPath) - 1] != '') $this->sPath .= '/';
119
+                    if (mb_strpos($aPath[count($aPath) - 1], '.') === false && $aPath[count($aPath) - 1] != '') {
120
+                        $this->sPath .= '/';
121
+                    }
120 122
 
121
-                    if ($this->sPath[strlen($this->sPath) - 1] == '/') $this->sPath .= 'index.html';
123
+                    if ($this->sPath[strlen($this->sPath) - 1] == '/') {
124
+                        $this->sPath .= 'index.html';
125
+                    }
122 126
 
123 127
                     $this->P = new UserPage($this->serviceManager, $this->sPath);
124 128
                 }
Please login to merge, or discard this patch.
src/HCSF.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
         $this->setupHardcodedTextcats();
32 32
 
33
-        $this->serviceManager->setFactory('db', function () {
33
+        $this->serviceManager->setFactory('db', function() {
34 34
             return null;
35 35
         });
36 36
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $this->setupTwig();
44 44
 
45 45
         if (HelperConfig::$core["enable_module_shop"]) {
46
-            $this->serviceManager->setFactory('oItem', function (ServiceManager $serviceManager) {
46
+            $this->serviceManager->setFactory('oItem', function(ServiceManager $serviceManager) {
47 47
                 return new \HaaseIT\HCSF\Shop\Items($serviceManager);
48 48
             });
49 49
         }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         // PSR-7 Stuff
58 58
         // Init request object
59
-        $this->serviceManager->setFactory('request', function () {
59
+        $this->serviceManager->setFactory('request', function() {
60 60
             $request = \Zend\Diactoros\ServerRequestFactory::fromGlobals();
61 61
 
62 62
             // cleanup request
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 // session.use_trans_sid wenn nötig aktivieren
77 77
             ini_set('session.use_only_cookies', 0);
78 78
             session_name('sid');
79
-            if(ini_get('session.use_trans_sid') == 1) {
79
+            if (ini_get('session.use_trans_sid') == 1) {
80 80
                 ini_set('session.use_trans_sid', 0);
81 81
             }
82 82
 // Session wenn nötig starten
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
     protected function setupDB()
122 122
     {
123
-        $this->serviceManager->setFactory('dbal', function () {
123
+        $this->serviceManager->setFactory('dbal', function() {
124 124
             $config = new \Doctrine\DBAL\Configuration();
125 125
 
126 126
             $connectionParams = [
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
             return \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
142 142
         });
143 143
 
144
-        $this->serviceManager->setFactory('db', function (ServiceManager $serviceManager) {
144
+        $this->serviceManager->setFactory('db', function(ServiceManager $serviceManager) {
145 145
             return $serviceManager->get('dbal')->getWrappedConnection();
146 146
         });
147 147
     }
148 148
 
149 149
     protected function setupTextcats()
150 150
     {
151
-        $this->serviceManager->setFactory('textcats', function (ServiceManager $serviceManager) {
151
+        $this->serviceManager->setFactory('textcats', function(ServiceManager $serviceManager) {
152 152
             $langavailable = HelperConfig::$core["lang_available"];
153 153
             $textcats = new \HaaseIT\Toolbox\Textcat(
154 154
                 HelperConfig::$lang,
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
     protected function setupTwig()
167 167
     {
168
-        $this->serviceManager->setFactory('twig', function (ServiceManager $serviceManager) {
168
+        $this->serviceManager->setFactory('twig', function(ServiceManager $serviceManager) {
169 169
             $loader = new \Twig_Loader_Filesystem([PATH_BASEDIR.'customviews', HCSF_BASEDIR.'src/views/']);
170 170
 
171 171
             $twig_options = [
Please login to merge, or discard this patch.