@@ -32,7 +32,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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) |
@@ -16,15 +16,15 @@ discard block |
||
| 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 |
||
| 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.'); |
@@ -31,7 +31,7 @@ |
||
| 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); |
@@ -231,9 +231,9 @@ |
||
| 231 | 231 | public function getConfiguration($config = null) |
| 232 | 232 | { |
| 233 | 233 | if ($config !== null) { |
| 234 | - if (! empty($this->configuration->$config)) { |
|
| 234 | + if (!empty($this->configuration->$config)) { |
|
| 235 | 235 | return $this->configuration->$config; |
| 236 | - } elseif (! empty($this->files{$config})) { |
|
| 236 | + } elseif (!empty($this->files{$config})) { |
|
| 237 | 237 | $vars = include $this->files{$config}; |
| 238 | 238 | |
| 239 | 239 | if ($vars === false) { |
@@ -114,7 +114,7 @@ discard block |
||
| 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 |
||
| 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; |
@@ -172,7 +172,7 @@ discard block |
||
| 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) { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | //@TODO this will not accept all float values, this validates /against/ syntax |
| 349 | 349 | |
| 350 | 350 | if (($int === (int)trim($data, '-')) && strlen((string)(int)$data) === strlen($data)) { |
| 351 | - $data = (int) $data; |
|
| 351 | + $data = (int)$data; |
|
| 352 | 352 | } elseif ($int !== $float && preg_match($re, $data) === 1) { |
| 353 | 353 | $data = floatval($data); |
| 354 | 354 | } |
@@ -368,12 +368,12 @@ discard block |
||
| 368 | 368 | $container = $name . 'Container'; |
| 369 | 369 | $container = $this->$container; |
| 370 | 370 | |
| 371 | - $argument = ! empty($arguments[0]) ? $arguments[0] : false; |
|
| 371 | + $argument = !empty($arguments[0]) ? $arguments[0] : false; |
|
| 372 | 372 | |
| 373 | 373 | if ($argument === false && !empty($container)) { |
| 374 | 374 | return $container; |
| 375 | 375 | } |
| 376 | - if (! empty($container[$argument])) { |
|
| 376 | + if (!empty($container[$argument])) { |
|
| 377 | 377 | if (!is_array($container[$argument]) |
| 378 | 378 | && !is_object($container[$argument]) |
| 379 | 379 | && strlen($container[$argument]) > 0 |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - return ! empty($arguments[1]) ? $arguments[1] : false; |
|
| 387 | + return !empty($arguments[1]) ? $arguments[1] : false; |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | throw new Exception\FunctionException('Method ' . $name . ' does not exist.'); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if (!preg_match("/^[a-z0-9:_\/\.\[\]-]+$/i", $uri) |
| 143 | 143 | || array_filter( |
| 144 | 144 | $uriChunks, |
| 145 | - function ($uriChunk) { |
|
| 145 | + function($uriChunk) { |
|
| 146 | 146 | if (strpos($uriChunk, '__') !== false) { |
| 147 | 147 | return true; |
| 148 | 148 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | $normalizedURI = ltrim(preg_replace('/\?.*/', '', $normalizedURI), '/'); |
| 227 | 227 | |
| 228 | - if (! empty($this->routes)) { |
|
| 228 | + if (!empty($this->routes)) { |
|
| 229 | 229 | $normalizedURI = $this->discoverRoute($normalizedURI); |
| 230 | 230 | } |
| 231 | 231 | |
@@ -244,11 +244,11 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | $uri = $reroute; |
| 246 | 246 | |
| 247 | - if (! empty($params)) { |
|
| 247 | + if (!empty($params)) { |
|
| 248 | 248 | $pat = '/(\$\d+)/'; |
| 249 | 249 | $uri = preg_replace_callback( |
| 250 | 250 | $pat, |
| 251 | - function () use (&$params) { |
|
| 251 | + function() use (&$params) { |
|
| 252 | 252 | $first = $params[0]; |
| 253 | 253 | array_shift($params); |
| 254 | 254 | return $first; |