@@ -154,6 +154,9 @@ |
||
154 | 154 | $this->addRequestHeader($name, $value); |
155 | 155 | } |
156 | 156 | |
157 | + /** |
|
158 | + * @param string $headerName |
|
159 | + */ |
|
157 | 160 | private function removeRequestHeader($headerName) |
158 | 161 | { |
159 | 162 | if (array_key_exists($headerName, $this->requestHeaders)) { |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Zend\Diactoros\Stream; |
10 | 10 | use Psr\Http\Message\RequestInterface; |
11 | 11 | use Psr\Http\Message\ResponseInterface; |
12 | -use Behat\Gherkin\Node\PyStringNode; |
|
13 | 12 | |
14 | 13 | class RestApiBrowser |
15 | 14 | { |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | $app->match( |
16 | 16 | 'echo', |
17 | - function (Request $req) { |
|
17 | + function(Request $req) { |
|
18 | 18 | $ret = array( |
19 | 19 | 'warning' => 'Do not expose this service in production : it is intrinsically unsafe', |
20 | 20 | ); |
@@ -39,9 +39,9 @@ |
||
39 | 39 | $validator->check($json->getRawContent(), $this->getRawContent()); |
40 | 40 | |
41 | 41 | if (!$validator->isValid()) { |
42 | - $msg = "JSON does not validate. Violations:".PHP_EOL; |
|
42 | + $msg = "JSON does not validate. Violations:" . PHP_EOL; |
|
43 | 43 | foreach ($validator->getErrors() as $error) { |
44 | - $msg .= sprintf(" - [%s] %s".PHP_EOL, $error['property'], $error['message']); |
|
44 | + $msg .= sprintf(" - [%s] %s" . PHP_EOL, $error['property'], $error['message']); |
|
45 | 45 | } |
46 | 46 | throw new \Exception($msg); |
47 | 47 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | if ($e === null) { |
113 | - throw new \Exception(sprintf("The node '%s' exists and contains '%s'.", $jsonNode , json_encode($realValue))); |
|
113 | + throw new \Exception(sprintf("The node '%s' exists and contains '%s'.", $jsonNode, json_encode($realValue))); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | )); |
179 | 179 | } |
180 | 180 | |
181 | - $filename = $this->jsonSchemaBaseUrl.'/'.$filename; |
|
181 | + $filename = $this->jsonSchemaBaseUrl . '/' . $filename; |
|
182 | 182 | |
183 | 183 | if (false === is_file($filename)) { |
184 | 184 | throw new \RuntimeException(sprintf( |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | $container->setParameter('rezzza.json_api.rest.base_url', $config['rest']['base_url']); |
18 | 18 | $container->setParameter('rezzza.json_api.rest.adaptor_name', $config['rest']['adaptor_name']); |
19 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Resources')); |
|
19 | + $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/Resources')); |
|
20 | 20 | $loader->load('services.xml'); |
21 | 21 | |
22 | 22 | if (true === $config['rest']['store_response']) { |