@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | $cleanup = ['Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified']; |
| 32 | 32 | |
| 33 | - foreach ($cleanup as $header) { |
|
| 33 | + foreach ( $cleanup as $header ) { |
|
| 34 | 34 | $this->response->getHeaders()->delete($header); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | // An Allow Header should be provided from DispatcherException |
| 34 | 34 | $allow = $this->response->getHeaders()->get('Allow'); |
| 35 | 35 | |
| 36 | - if (is_null($allow)) throw new Exception("Missing Allow header"); |
|
| 36 | + if ( is_null($allow) ) throw new Exception("Missing Allow header"); |
|
| 37 | 37 | |
| 38 | 38 | parent::consolidate(); |
| 39 | 39 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function send($replace = false) { |
| 32 | 32 | |
| 33 | - foreach ($this->headers as $header => $value) { |
|
| 33 | + foreach ( $this->headers as $header => $value ) { |
|
| 34 | 34 | |
| 35 | 35 | header($header.": ".$value, $replace); |
| 36 | 36 | |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | use ResponseTrait; |
| 49 | 49 | use ExtraTrait; |
| 50 | 50 | |
| 51 | - protected static $supported_methods = ['GET','PUT','POST','DELETE','OPTIONS','HEAD','TRACE','CONNECT','PURGE']; |
|
| 51 | + protected static $supported_methods = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'TRACE', 'CONNECT', 'PURGE']; |
|
| 52 | 52 | |
| 53 | 53 | public function __construct( |
| 54 | 54 | Configuration $configuration, |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $logger->debug("Emitting global dispatcher event."); |
| 126 | 126 | $events->emit(new DispatcherEvent($this)); |
| 127 | 127 | |
| 128 | - if ($configuration->get('enabled') === false) { |
|
| 128 | + if ( $configuration->get('enabled') === false ) { |
|
| 129 | 129 | |
| 130 | 130 | $logger->debug("Dispatcher disabled, shutting down gracefully."); |
| 131 | 131 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $events->emit($this->createServiceSpecializedEvents('dispatcher.request.'.$this->request->getMethod()->get())); |
| 146 | 146 | $events->emit($this->createServiceSpecializedEvents('dispatcher.request.#')); |
| 147 | 147 | |
| 148 | - if ($cache->read($this->request, $this->response)) { |
|
| 148 | + if ( $cache->read($this->request, $this->response) ) { |
|
| 149 | 149 | // we have a cache! |
| 150 | 150 | // shutdown immediately |
| 151 | 151 | return $this->shutdown(); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | try { |
| 184 | 184 | |
| 185 | - switch ($route_type) { |
|
| 185 | + switch ( $route_type ) { |
|
| 186 | 186 | |
| 187 | 187 | case 'ROUTE': |
| 188 | 188 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $params = $route->getParameter('headers'); |
| 231 | 231 | |
| 232 | 232 | if ( !empty($params) && is_array($params) ) { |
| 233 | - foreach($params as $name => $value) { |
|
| 233 | + foreach ( $params as $name => $value ) { |
|
| 234 | 234 | $this->getResponse()->getHeaders()->set($name, $value); |
| 235 | 235 | } |
| 236 | 236 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $code = $route->getRedirectCode(); |
| 247 | 247 | |
| 248 | 248 | $location = $route->getRedirectLocation(); |
| 249 | - $uri = empty($location) ? (string) $this->getRequest()->getUri() : $location; |
|
| 249 | + $uri = empty($location) ? (string)$this->getRequest()->getUri() : $location; |
|
| 250 | 250 | |
| 251 | 251 | $message = $route->getRedirectMessage(); |
| 252 | 252 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | if ( !empty($code) ) { |
| 266 | 266 | $status->set($code); |
| 267 | 267 | } else if ( $this->getRequest()->getVersion() == 'HTTP/1.1' ) { |
| 268 | - $status->set( (string) $this->getRequest()->getMethod() !== 'GET' ? 303 : 307); |
|
| 268 | + $status->set((string)$this->getRequest()->getMethod() !== 'GET' ? 303 : 307); |
|
| 269 | 269 | } else { |
| 270 | 270 | $status->set(302); |
| 271 | 271 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | $cache_object = $this->getCache()->setNamespace(self::$cache_namespace)->get($name); |
| 49 | 49 | |
| 50 | - if (is_null($cache_object)) return false; |
|
| 50 | + if ( is_null($cache_object) ) return false; |
|
| 51 | 51 | |
| 52 | 52 | $response->import($cache_object); |
| 53 | 53 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $file = $this->getTemporaryName(); |
| 89 | 89 | |
| 90 | - if (file_exists($file)) { |
|
| 90 | + if ( file_exists($file) ) { |
|
| 91 | 91 | return file_get_contents($file); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function load($slugOrControl) { |
| 99 | 99 | |
| 100 | - if (isset($_FILES) && isset($_FILES[$slugOrControl])) { |
|
| 100 | + if ( isset($_FILES) && isset($_FILES[$slugOrControl]) ) { |
|
| 101 | 101 | |
| 102 | 102 | $this->loadFromUploadedFile($slugOrControl); |
| 103 | 103 | |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | public function save($path, $as_slug = false) { |
| 113 | 113 | |
| 114 | - if (!empty($path) && file_exists($path)) { |
|
| 114 | + if ( !empty($path) && file_exists($path) ) { |
|
| 115 | 115 | |
| 116 | 116 | $local_name = "$path/".($as_slug ? $this->getSlug() : $this->getFileName()); |
| 117 | 117 | |
| 118 | - if (file_exists($local_name)) { |
|
| 118 | + if ( file_exists($local_name) ) { |
|
| 119 | 119 | |
| 120 | 120 | $files = glob("$local_name*"); |
| 121 | 121 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - if (move_uploaded_file($this->getTemporaryName(), $local_name)) { |
|
| 128 | + if ( move_uploaded_file($this->getTemporaryName(), $local_name) ) { |
|
| 129 | 129 | |
| 130 | 130 | // return file_exists($local_name); |
| 131 | 131 | return true; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | $files = array(); |
| 169 | 169 | |
| 170 | - foreach ($_FILES as $idx => $data) { |
|
| 170 | + foreach ( $_FILES as $idx => $data ) { |
|
| 171 | 171 | |
| 172 | 172 | $files[] = new File($idx, $repository); |
| 173 | 173 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function __construct() { |
| 30 | 30 | |
| 31 | - foreach ($_FILES as $idx => $data) { |
|
| 31 | + foreach ( $_FILES as $idx => $data ) { |
|
| 32 | 32 | |
| 33 | 33 | $this->files[] = new File($idx); |
| 34 | 34 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | private static function getParameters() { |
| 48 | 48 | |
| 49 | - switch ($_SERVER['REQUEST_METHOD']) { |
|
| 49 | + switch ( $_SERVER['REQUEST_METHOD'] ) { |
|
| 50 | 50 | |
| 51 | 51 | case 'POST': |
| 52 | 52 | |