@@ -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 |
@@ -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, |
@@ -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 |
@@ -41,13 +41,13 @@ |
||
41 | 41 | */ |
42 | 42 | private static function getHeaders() { |
43 | 43 | |
44 | - if (function_exists('getallheaders')) return getallheaders(); |
|
44 | + if ( function_exists('getallheaders') ) return getallheaders(); |
|
45 | 45 | |
46 | 46 | $headers = array(); |
47 | 47 | |
48 | - foreach ($_SERVER as $name => $value) { |
|
48 | + foreach ( $_SERVER as $name => $value ) { |
|
49 | 49 | |
50 | - if (substr($name, 0, 5) == 'HTTP_') { |
|
50 | + if ( substr($name, 0, 5) == 'HTTP_' ) { |
|
51 | 51 | |
52 | 52 | $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; |
53 | 53 |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | $status = $response->getStatus()->get(); |
77 | 77 | |
78 | - if (!$this->codes->exists($status)) throw new Exception("Invalid HTTP status code in response"); |
|
78 | + if ( !$this->codes->exists($status) ) throw new Exception("Invalid HTTP status code in response"); |
|
79 | 79 | |
80 | 80 | $message = $this->codes->getMessage($status); |
81 | 81 |
@@ -102,7 +102,7 @@ |
||
102 | 102 | |
103 | 103 | public function getMessage($code) { |
104 | 104 | |
105 | - if ($this->exists($code)) return $this->codes[$code]; |
|
105 | + if ( $this->exists($code) ) return $this->codes[$code]; |
|
106 | 106 | |
107 | 107 | throw new Exception("Invalid HTTP status code $code"); |
108 | 108 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $type = $this->response->getContent()->type(); |
34 | 34 | $charset = $this->response->getContent()->charset(); |
35 | 35 | |
36 | - if (empty($charset)) { |
|
36 | + if ( empty($charset) ) { |
|
37 | 37 | $this->response->getHeaders()->set("Content-type", strtolower($type)); |
38 | 38 | } else { |
39 | 39 | $this->response->getHeaders()->set("Content-type", strtolower($type)."; charset=".$charset); |