Completed
Pull Request — master (#70)
by
unknown
02:33
created
Zewa/SessionHandler.php 1 patch
Spacing   +4 added lines, -4 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)) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
         if ($interface !== 'file') {
80 80
             try {
81
-                $database = new Database();//App::getService('database')->fetchConnection();
81
+                $database = new Database(); //App::getService('database')->fetchConnection();
82 82
                 $this->dbh = $database->fetchConnection('default');
83 83
 
84 84
                 session_set_save_handler(
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     public function destroy($sessionId)
166 166
     {
167 167
         $success = false;
168
-        $query = "DELETE FROM ". $this->tableName
168
+        $query = "DELETE FROM " . $this->tableName
169 169
             . " WHERE id = ?";
170 170
 
171 171
         $success = $this->dbh->prepare($query)
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     public function gc()
182 182
     {
183 183
 
184
-        $query = "DELETE FROM ". $this->tableName
184
+        $query = "DELETE FROM " . $this->tableName
185 185
             . " WHERE session_expire < ?";
186 186
 
187 187
         return $this->dbh->prepare($query)
Please login to merge, or discard this patch.
Zewa/ServiceManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public function __construct()
18 18
     {
19
-        $database = function () {
19
+        $database = function() {
20 20
             return new Database();
21 21
         };
22 22
 
23
-        $router = function () {
23
+        $router = function() {
24 24
             return new Router();
25 25
         };
26 26
 
27
-        $request = function () {
27
+        $request = function() {
28 28
             return new Request();
29 29
         };
30 30
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function __get($property)
37 37
     {
38
-        if (! empty($this->services[$property])) {
38
+        if (!empty($this->services[$property])) {
39 39
             return $this->services[$property];
40 40
         }
41 41
         throw new Exception\LookupException('The service: ' . $property . ' hasn\'t been registered.');
Please login to merge, or discard this patch.
Zewa/Database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public function establishConnection($name = 'default')
32 32
     {
33 33
         if ($this->configuration !== false) {
34
-            if (! empty($this->configuration->$name)) {
34
+            if (!empty($this->configuration->$name)) {
35 35
                 $dbConfig = $this->configuration->$name;
36 36
                 self::$dbh[$name] = new \PDO($dbConfig->dsn, $dbConfig->user, $dbConfig->pass);
37 37
                 self::$dbh[$name]->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
Please login to merge, or discard this patch.
Zewa/Router.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         if (!preg_match("/^[a-z0-9:_\/\.\[\]-]+$/i", $uri)
135 135
             || array_filter(
136 136
                 $uriChunks,
137
-                function ($uriChunk) {
137
+                function($uriChunk) {
138 138
                     if (strpos($uriChunk, '__') !== false) {
139 139
                         return true;
140 140
                     }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
         $normalizedURI = ltrim(preg_replace('/\?.*/', '', $normalizedURI), '/');
220 220
 
221
-        if (! empty($this->configuration->routes)) {
221
+        if (!empty($this->configuration->routes)) {
222 222
             $normalizedURI = $this->discoverRoute($normalizedURI);
223 223
         }
224 224
         
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 
238 238
                 $uri = $reroute;
239 239
 
240
-                if (! empty($params)) {
240
+                if (!empty($params)) {
241 241
                     $pat = '/(\$\d+)/';
242 242
                     $uri = preg_replace_callback(
243 243
                         $pat,
244
-                        function () use (&$params) {
244
+                        function() use (&$params) {
245 245
                             $first = $params[0];
246 246
                             array_shift($params);
247 247
                             return $first;
Please login to merge, or discard this patch.
Zewa/View.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $this->view = $this->process($this->view);
115 115
             }
116 116
 
117
-            if (! is_null($this->layout)) {
117
+            if (!is_null($this->layout)) {
118 118
                 return $this->process($this->layout);
119 119
             } else {
120 120
                 return $this->view;
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         }
248 248
 
249 249
         foreach ($sheets as $sheet) {
250
-            $string .= '<link rel="stylesheet" href="' . $sheet .'">' . "\r\n";
250
+            $string .= '<link rel="stylesheet" href="' . $sheet . '">' . "\r\n";
251 251
         }
252 252
 
253 253
         return $string;
Please login to merge, or discard this patch.
Zewa/App.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             }
189 189
         }
190 190
 
191
-        if(is_null($this->services)) {
191
+        if (is_null($this->services)) {
192 192
             $this->services = (object)[];
193 193
         }
194 194
     }
@@ -223,9 +223,9 @@  discard block
 block discarded – undo
223 223
     public function getConfiguration($config = null)
224 224
     {
225 225
         if ($config !== null) {
226
-            if (! empty($this->configuration->$config)) {
226
+            if (!empty($this->configuration->$config)) {
227 227
                 return $this->configuration->$config;
228
-            } elseif (! empty($this->files{$config})) {
228
+            } elseif (!empty($this->files{$config})) {
229 229
                 $vars = include $this->files{$config};
230 230
 
231 231
                 if ($vars === false) {
Please login to merge, or discard this patch.
Zewa/Request.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $app = App::getInstance();
128 128
         $this->configuration = $app->getConfiguration();
129 129
 
130
-        if( !empty($this->configuration->session) ) {
130
+        if (!empty($this->configuration->session)) {
131 131
             if ($this->configuration->session !== false && $this->configuration->session->flashdataId) {
132 132
                 $this->flashdataId = $this->configuration->session->flashdataId;
133 133
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                 // iterate through all the entries
173 173
                 foreach ($this->flashdata as $variable => $data) {
174 174
                     // increment counter representing server requests
175
-                    $this->flashdata[$variable]['inc'] ++;
175
+                    $this->flashdata[$variable]['inc']++;
176 176
 
177 177
                     // if we're past the first server request
178 178
                     if ($this->flashdata[$variable]['inc'] > 1) {
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
 
353 353
             if (is_numeric($data)) {
354 354
                 if ((intval($data) === (int)trim($data, '-')) && strlen((string)(int)$data) === strlen($data)) {
355
-                    $data = (int) $data;
355
+                    $data = (int)$data;
356 356
                 } elseif ($data === (string)(float)$data) {
357
-                    $data = (float) $data;
357
+                    $data = (float)$data;
358 358
                 }
359 359
             } else {
360 360
                 //                $data = $this->purifier->purify($data);
@@ -372,12 +372,12 @@  discard block
 block discarded – undo
372 372
             $container = $name . 'Container';
373 373
             $container = $this->$container;
374 374
 
375
-            $argument = ! empty($arguments[0]) ? $arguments[0] : false;
375
+            $argument = !empty($arguments[0]) ? $arguments[0] : false;
376 376
 
377 377
             if ($argument === false && !empty($container)) {
378 378
                 return $container;
379 379
             }
380
-            if (! empty($container[$argument])) {
380
+            if (!empty($container[$argument])) {
381 381
                 if (!is_array($container[$argument])
382 382
                     && !is_object($container[$argument])
383 383
                     && strlen($container[$argument]) > 0
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                 }
389 389
             }
390 390
 
391
-            return ! empty($arguments[1]) ? $arguments[1] : false;
391
+            return !empty($arguments[1]) ? $arguments[1] : false;
392 392
         }
393 393
 
394 394
         throw new Exception\FunctionException('Method ' . $name . ' does not exist.');
Please login to merge, or discard this patch.