@@ -46,7 +46,7 @@ |
||
46 | 46 | $newName = $this->getFileName($key); |
47 | 47 | } |
48 | 48 | |
49 | - move_uploaded_file($this->getFileByKey($key, 'tmp_name'), $destinationPath . '/' . $newName); |
|
49 | + move_uploaded_file($this->getFileByKey($key, 'tmp_name'), $destinationPath.'/'.$newName); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function clearTemp($key) |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function add($object) |
21 | 21 | { |
22 | 22 | if (!is_object($object) && !is_array($object)) { |
23 | - $object = [ $object ]; |
|
23 | + $object = [$object]; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | if ($this->serializationRule !== ResponseBag::SINGLE_OBJECT) { |
@@ -186,13 +186,13 @@ |
||
186 | 186 | $servername = $this->getServerName(); |
187 | 187 | |
188 | 188 | if ($port && $this->server('SERVER_PORT' !== false)) { |
189 | - $servername .= ':' . $this->server('SERVER_PORT'); |
|
189 | + $servername .= ':'.$this->server('SERVER_PORT'); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | if ($protocol) { |
193 | 193 | $servername = ( |
194 | 194 | ($this->server('HTTPS') !== 'off' |
195 | - || $this->server('SERVER_PORT') == 443) ? "https://" : "http://") . $servername |
|
195 | + || $this->server('SERVER_PORT') == 443) ? "https://" : "http://").$servername |
|
196 | 196 | ; |
197 | 197 | } |
198 | 198 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | { |
69 | 69 | if (method_exists($this->handler, 'addDataTable')) { |
70 | 70 | $data = $this->handler->getDataTable(); |
71 | - $this->handler->addDataTable('Info #' . (count($data) + 1), array($name => $value)); |
|
71 | + $this->handler->addDataTable('Info #'.(count($data) + 1), array($name => $value)); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
@@ -96,7 +96,7 @@ |
||
96 | 96 | new RoutePattern( |
97 | 97 | $route->getMethod(), |
98 | 98 | $route->getPattern(), |
99 | - function () use ($route) { |
|
99 | + function() use ($route) { |
|
100 | 100 | return new MockOutputProcessor($route->getOutputProcessor()); |
101 | 101 | }, |
102 | 102 | $class, |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function getDispatcher() |
48 | 48 | { |
49 | 49 | // Generic Dispatcher for RestServer |
50 | - return simpleDispatcher(function (RouteCollector $r) { |
|
50 | + return simpleDispatcher(function(RouteCollector $r) { |
|
51 | 51 | |
52 | 52 | foreach ($this->getRoutes() as $route) { |
53 | 53 | $r->addRoute( |
@@ -125,8 +125,9 @@ |
||
125 | 125 | |
126 | 126 | // loop data blocks |
127 | 127 | foreach ($blocks as $id => $block) { |
128 | - if (empty($block)) |
|
129 | - continue; |
|
128 | + if (empty($block)) { |
|
129 | + continue; |
|
130 | + } |
|
130 | 131 | |
131 | 132 | $name = []; |
132 | 133 | preg_match('/\bname=\"([^\"]*)\"\s*;/s', $block, $name); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * @var Request |
12 | 12 | */ |
13 | - protected $psrRequest ; |
|
13 | + protected $psrRequest; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->server["REMOTE_ADDR"] = "127.0.0.1"; |
54 | 54 | $this->server["REMOTE_PORT"] = rand(1000, 60000); |
55 | 55 | $this->server["SERVER_SOFTWARE"] = "Mock"; |
56 | - $this->server["SERVER_PROTOCOL"] = "HTTP/" . $this->psrRequest->getProtocolVersion(); |
|
56 | + $this->server["SERVER_PROTOCOL"] = "HTTP/".$this->psrRequest->getProtocolVersion(); |
|
57 | 57 | $this->server["SERVER_NAME"] = $this->psrRequest->getUri()->getHost(); |
58 | 58 | $this->server["SERVER_PORT"] = $this->psrRequest->getUri()->getPort(); |
59 | 59 | $this->server["REQUEST_URI"] = $this->psrRequest->getRequestTarget(); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | // Headers and Cookies |
71 | 71 | $this->cookie = []; |
72 | 72 | foreach ($this->psrRequest->getHeaders() as $key => $value) { |
73 | - $this->server["HTTP_" . strtoupper($key)] = $this->psrRequest->getHeaderLine($key); |
|
73 | + $this->server["HTTP_".strtoupper($key)] = $this->psrRequest->getHeaderLine($key); |
|
74 | 74 | |
75 | 75 | if ($key == "Cookie") { |
76 | 76 | parse_str(preg_replace("/;\s*/", "&", $this->psrRequest->getHeaderLine($key)), $this->cookie); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'name' => $filename[1], |
158 | 158 | 'type' => (empty($contentType) ? "" : trim($contentType[1])), |
159 | 159 | 'size' => strlen($content), |
160 | - 'tmp_name' => sys_get_temp_dir() . "/" . $filename[1], |
|
160 | + 'tmp_name' => sys_get_temp_dir()."/".$filename[1], |
|
161 | 161 | 'error' => null |
162 | 162 | ]; |
163 | 163 | file_put_contents($strut["tmp_name"], $content); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function withOutputProcessorForRoute($method, $path, $processor) |
55 | 55 | { |
56 | - $this->overrideOutputProcessor[strtoupper($method) . " " . $path] = $processor; |
|
56 | + $this->overrideOutputProcessor[strtoupper($method)." ".$path] = $processor; |
|
57 | 57 | return $this; |
58 | 58 | } |
59 | 59 | |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | ); |
118 | 118 | } |
119 | 119 | |
120 | - $outputProcessor = $this->getMethodOutputProcessor($method, $basePath. $path, $properties); |
|
120 | + $outputProcessor = $this->getMethodOutputProcessor($method, $basePath.$path, $properties); |
|
121 | 121 | |
122 | 122 | $routes[] = new RoutePattern( |
123 | 123 | strtoupper($method), |
124 | - $basePath . $path, |
|
124 | + $basePath.$path, |
|
125 | 125 | $outputProcessor, |
126 | 126 | $parts[0], |
127 | 127 | $parts[1] |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | protected function sortPaths($pathList) |
136 | 136 | { |
137 | - usort($pathList, function ($left, $right) { |
|
137 | + usort($pathList, function($left, $right) { |
|
138 | 138 | if (strpos($left, '{') === false && strpos($right, '{') !== false) { |
139 | 139 | return -16384; |
140 | 140 | } |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | */ |
163 | 163 | protected function getMethodOutputProcessor($method, $path, $properties) |
164 | 164 | { |
165 | - $key = strtoupper($method) . " " . $path; |
|
165 | + $key = strtoupper($method)." ".$path; |
|
166 | 166 | if (isset($this->overrideOutputProcessor[$key])) { |
167 | 167 | return $this->overrideOutputProcessor[$key]; |
168 | 168 | } |
169 | 169 | |
170 | 170 | $produces = null; |
171 | 171 | if (isset($properties['produces'])) { |
172 | - $produces = (array) $properties['produces']; |
|
172 | + $produces = (array)$properties['produces']; |
|
173 | 173 | } |
174 | 174 | if (empty($produces) && isset($properties["responses"]["200"]["content"])) { |
175 | 175 | $produces = array_keys($properties["responses"]["200"]["content"]); |
@@ -40,8 +40,8 @@ |
||
40 | 40 | public function getDetailedErrorHandler(); |
41 | 41 | |
42 | 42 | /** |
43 | - * @return Handler |
|
44 | - */ |
|
43 | + * @return Handler |
|
44 | + */ |
|
45 | 45 | public function getErrorHandler(); |
46 | 46 | |
47 | 47 | /** |