@@ -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) |
@@ -132,7 +132,7 @@ |
||
132 | 132 | foreach ($this->headers as $header => $values) { |
133 | 133 | $replace = true; |
134 | 134 | foreach ($values as $value) { |
135 | - $result[] = [ "$header: $value", $replace ]; |
|
135 | + $result[] = ["$header: $value", $replace]; |
|
136 | 136 | $replace = false; |
137 | 137 | } |
138 | 138 | } |
@@ -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 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | |
128 | 128 | // Process Class::Method() |
129 | 129 | $function = $class[1]; |
130 | - $class = $class[0]; |
|
130 | + $class = $class[0]; |
|
131 | 131 | if (!class_exists($class)) { |
132 | 132 | throw new ClassNotFoundException("Class '$class' defined in the route is not found"); |
133 | 133 | } |
@@ -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( |
@@ -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); |