Completed
Pull Request — master (#66)
by
unknown
02:40
created
Zewa/Router.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     {
133 133
         if (!preg_match("/^[a-z0-9:_\/\.\[\]-]+$/i", $uri)
134 134
             || array_filter(
135
-                $uriChunks, function ($uriChunk) {
135
+                $uriChunks, function($uriChunk) {
136 136
                     if (strpos($uriChunk, '__') !== false) {
137 137
                         return true;
138 138
                     }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
         $normalizedURI = ltrim(preg_replace('/\?.*/', '', $normalizedURI), '/');
218 218
 
219
-        if (! empty($this->configuration->routes)) {
219
+        if (!empty($this->configuration->routes)) {
220 220
             $normalizedURI = $this->discoverRoute($normalizedURI);
221 221
         }
222 222
         
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 
236 236
                 $uri = $reroute;
237 237
 
238
-                if (! empty($params)) {
238
+                if (!empty($params)) {
239 239
                     $pat = '/(\$\d+)/';
240 240
                     $uri = preg_replace_callback(
241
-                        $pat, function () use (&$params) {
241
+                        $pat, function() use (&$params) {
242 242
                             $first = $params[0];
243 243
                             array_shift($params);
244 244
                             return $first;
Please login to merge, or discard this patch.
Zewa/SessionHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         ini_set('session.cookie_domain', $domain);
33 33
 
34 34
         if ($session_lifetime != '' && is_integer($session_lifetime)) {
35
-            ini_set('session.gc_maxlifetime', (int) $session_lifetime);
35
+            ini_set('session.gc_maxlifetime', (int)$session_lifetime);
36 36
         }
37 37
 
38 38
         if ($gc_probability != '' && is_integer($gc_probability)) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         if ($interface !== 'file') {
78 78
             try {
79 79
                 //@TODO: database should be pulling an instance or DI.
80
-                $database = new Database();//App::getService('database')->fetchConnection();
80
+                $database = new Database(); //App::getService('database')->fetchConnection();
81 81
                 $this->dbh = $database->fetchConnection('default');
82 82
 
83 83
                 session_set_save_handler(
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     public function destroy($sessionId)
164 164
     {
165 165
         $success = false;
166
-        $query = "DELETE FROM ". $this->tableName
166
+        $query = "DELETE FROM " . $this->tableName
167 167
             . " WHERE id = ?";
168 168
 
169 169
         $success = $this->dbh->prepare($query)
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     public function gc()
180 180
     {
181 181
 
182
-        $query = "DELETE FROM ". $this->tableName
182
+        $query = "DELETE FROM " . $this->tableName
183 183
             . " WHERE session_expire < ?";
184 184
 
185 185
         return $this->dbh->prepare($query)
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                 . ") ENGINE=InnoDB DEFAULT CHARSET=utf8";
311 311
 
312 312
             $this->dbh->prepare($query)->execute();
313
-        } catch(\PDOException $e) {
313
+        } catch (\PDOException $e) {
314 314
             print_r($e->getMessage());
315 315
         }
316 316
         die('test');
Please login to merge, or discard this patch.
Zewa/App.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
     private function prepareServices()
190 190
     {
191
-        if(isset($this->files['services'])) {
191
+        if (isset($this->files['services'])) {
192 192
             $services = include $this->files['services'];
193 193
             if ($services === false) {
194 194
                 $this->services = [];
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
     public function getService($service, $new = false, $options = [])
204 204
     {
205
-        if($this->services === null) {
205
+        if ($this->services === null) {
206 206
             $this->prepareServices();
207 207
         }
208 208
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
     public function setService($service, $class)
218 218
     {
219
-        if($this->services === null) {
219
+        if ($this->services === null) {
220 220
             $this->prepareServices();
221 221
         }
222 222
 
@@ -230,9 +230,9 @@  discard block
 block discarded – undo
230 230
     public function getConfiguration($config = null)
231 231
     {
232 232
         if ($config !== null) {
233
-            if (! empty($this->configuration->$config)) {
233
+            if (!empty($this->configuration->$config)) {
234 234
                 return $this->configuration->$config;
235
-            } elseif(! empty($this->files{$config}) ) {
235
+            } elseif (!empty($this->files{$config})) {
236 236
 
237 237
                 $vars = include $this->files{$config};
238 238
 
Please login to merge, or discard this patch.