@@ -38,26 +38,26 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function resolve() |
40 | 40 | { |
41 | - if($this->app->has('clientReset')){ |
|
41 | + if ($this->app->has('clientReset')) { |
|
42 | 42 | $this->app->terminate('clientReset'); |
43 | 43 | return []; |
44 | 44 | } |
45 | 45 | |
46 | 46 | $inputs = $this->app->get($this->method); |
47 | 47 | |
48 | - $content = json_decode($this->app['request']->getContent(),1); |
|
48 | + $content = json_decode($this->app['request']->getContent(), 1); |
|
49 | 49 | |
50 | - if(is_array($inputs) && count($inputs)){ |
|
50 | + if (is_array($inputs) && count($inputs)) { |
|
51 | 51 | |
52 | - if(isset($inputs[$this->client->getClientName()])){ |
|
52 | + if (isset($inputs[$this->client->getClientName()])) { |
|
53 | 53 | return $inputs[$this->client->getClientName()]; |
54 | 54 | } |
55 | 55 | return $inputs; |
56 | 56 | } |
57 | 57 | |
58 | - if(is_array($content)){ |
|
58 | + if (is_array($content)) { |
|
59 | 59 | |
60 | - if(isset($content[$this->client->getClientName()])){ |
|
60 | + if (isset($content[$this->client->getClientName()])) { |
|
61 | 61 | return $content[$this->client->getClientName()]; |
62 | 62 | } |
63 | 63 | return $content; |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | |
66 | 66 | $this->inputVars(); |
67 | 67 | |
68 | - if(is_array($GLOBALS[ '_PUT' ])){ |
|
69 | - return $GLOBALS[ '_PUT' ]; |
|
68 | + if (is_array($GLOBALS['_PUT'])) { |
|
69 | + return $GLOBALS['_PUT']; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | return []; |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | // Fetch content and determine boundary |
97 | 97 | $boundary = substr($raw_data, 0, strpos($raw_data, "\r\n")); |
98 | 98 | |
99 | - if(empty($boundary)){ |
|
100 | - parse_str($raw_data,$data); |
|
101 | - $GLOBALS[ '_PUT' ] = $data; |
|
99 | + if (empty($boundary)) { |
|
100 | + parse_str($raw_data, $data); |
|
101 | + $GLOBALS['_PUT'] = $data; |
|
102 | 102 | return; |
103 | 103 | } |
104 | 104 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | foreach ($parts as $part) { |
110 | 110 | // If this is the last part, break |
111 | - if ($part == "--\r\n") break; |
|
111 | + if ($part=="--\r\n") break; |
|
112 | 112 | |
113 | 113 | // Separate content from headers |
114 | 114 | $part = ltrim($part, "\r\n"); |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | list(, $type, $name) = $matches; |
136 | 136 | |
137 | 137 | //Parse File |
138 | - if( isset($matches[4]) ) |
|
138 | + if (isset($matches[4])) |
|
139 | 139 | { |
140 | 140 | //if labeled the same as previous, skip |
141 | - if( isset( $_FILES[ $matches[ 2 ] ] ) ) |
|
141 | + if (isset($_FILES[$matches[2]])) |
|
142 | 142 | { |
143 | 143 | continue; |
144 | 144 | } |
@@ -147,16 +147,16 @@ discard block |
||
147 | 147 | $filename = $matches[4]; |
148 | 148 | |
149 | 149 | //get tmp name |
150 | - $filename_parts = pathinfo( $filename ); |
|
151 | - $tmp_name = tempnam( ini_get('upload_tmp_dir'), $filename_parts['filename']); |
|
150 | + $filename_parts = pathinfo($filename); |
|
151 | + $tmp_name = tempnam(ini_get('upload_tmp_dir'), $filename_parts['filename']); |
|
152 | 152 | |
153 | 153 | //populate $_FILES with information, size may be off in multibyte situation |
154 | 154 | /** @noinspection PhpUndefinedVariableInspection */ |
155 | - $_FILES[ $matches[ 2 ] ] = array( |
|
155 | + $_FILES[$matches[2]] = array( |
|
156 | 156 | 'error'=>0, |
157 | 157 | 'name'=>$filename, |
158 | 158 | 'tmp_name'=>$tmp_name, |
159 | - 'size'=>strlen( $body ), |
|
159 | + 'size'=>strlen($body), |
|
160 | 160 | 'type'=>$value |
161 | 161 | ); |
162 | 162 | |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | //Parse Field |
167 | 167 | else |
168 | 168 | { |
169 | - $data[$name] = substr($body, 0, strlen($body) - 2); |
|
169 | + $data[$name] = substr($body, 0, strlen($body)-2); |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | 173 | } |
174 | - $GLOBALS[ '_PUT' ] = $data; |
|
174 | + $GLOBALS['_PUT'] = $data; |
|
175 | 175 | return; |
176 | 176 | } |
177 | 177 |