@@ -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']) { |
@@ -170,8 +170,7 @@ |
||
| 170 | 170 | if (!empty($actual)) { |
| 171 | 171 | throw new \Exception(sprintf("The element '%s' exists and contains '%s'.", $element , $elements)); |
| 172 | 172 | } |
| 173 | - } |
|
| 174 | - catch (\Exception $e) { |
|
| 173 | + } catch (\Exception $e) { |
|
| 175 | 174 | } |
| 176 | 175 | } |
| 177 | 176 | |
@@ -161,7 +161,7 @@ |
||
| 161 | 161 | $elements = $this->theXmlElementShouldExist("{$element}[@{$attribute}]"); |
| 162 | 162 | $actual = $elements->item(0)->getAttribute($attribute); |
| 163 | 163 | if (!empty($actual)) { |
| 164 | - throw new \Exception(sprintf("The element '%s' exists and contains '%s'.", $element , $elements)); |
|
| 164 | + throw new \Exception(sprintf("The element '%s' exists and contains '%s'.", $element, $elements)); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | catch (\Exception $e) { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $app->match( |
| 18 | 18 | 'echo', |
| 19 | - function (Request $req) { |
|
| 19 | + function(Request $req) { |
|
| 20 | 20 | $ret = array( |
| 21 | 21 | 'warning' => 'Do not expose this service in production : it is intrinsically unsafe', |
| 22 | 22 | ); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $app->match( |
| 61 | 61 | 'redirect', |
| 62 | - function (Request $req) { |
|
| 62 | + function(Request $req) { |
|
| 63 | 63 | |
| 64 | 64 | return new RedirectResponse('do-not-expose-this-service-in-production.it/is-intrinsically-unsafe', Response::HTTP_MOVED_PERMANENTLY); |
| 65 | 65 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | try { |
| 30 | 30 | return new Xml($this->responseStorage->read()); |
| 31 | - } catch(\DOMException $e) { |
|
| 31 | + } catch (\DOMException $e) { |
|
| 32 | 32 | if ($throwExceptions) { |
| 33 | 33 | throw new \RuntimeException($e->getMessage()); |
| 34 | 34 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | // "fix" queries to the default namespace if any namespaces are defined |
| 53 | 53 | if (!empty($namespaces) && empty($defaultNamespacePrefix) && !empty($defaultNamespaceUri)) { |
| 54 | - for ($i=0; $i < 2; ++$i) { |
|
| 54 | + for ($i = 0; $i < 2; ++$i) { |
|
| 55 | 55 | $element = preg_replace('/\/(\w+)(\[[^]]+\])?\//', '/rootns:$1$2/', $element); |
| 56 | 56 | } |
| 57 | 57 | $element = preg_replace('/\/(\w+)(\[[^]]+\])?$/', '/rootns:$1$2', $element); |