Completed
Pull Request — behat-2.x (#42)
by Sébastien
04:44
created
src/Json/JsonSchema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Json/JsonContext.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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(
Please login to merge, or discard this patch.
src/Extension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
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']) {
Please login to merge, or discard this patch.
src/Xml/XmlContext.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             $elements = $this->theXmlElementShouldExist("{$element}[@{$attribute}]");
169 169
             $actual = $elements->item(0)->getAttribute($attribute);
170 170
             if (!empty($actual)) {
171
-                throw new \Exception(sprintf("The element '%s' exists and contains '%s'.", $element , $elements));
171
+                throw new \Exception(sprintf("The element '%s' exists and contains '%s'.", $element, $elements));
172 172
             }
173 173
         }
174 174
         catch (\Exception $e) {
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         }
309 309
         // "fix" queries to the default namespace if any namespaces are defined
310 310
         if (!empty($namespaces) && empty($defaultNamespacePrefix) && !empty($defaultNamespaceUri)) {
311
-            for ($i=0; $i < 2; ++$i) {
311
+            for ($i = 0; $i < 2; ++$i) {
312 312
                 $element = preg_replace('/\/(\w+)(\[[^]]+\])?\//', '/rootns:$1$2/', $element);
313 313
             }
314 314
             $element = preg_replace('/\/(\w+)(\[[^]]+\])?$/', '/rootns:$1$2', $element);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,8 +170,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Xml/XmlStorage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
                 }
40 40
             }
41 41
         }
42
-        catch(\DOMException $e) {
42
+        catch (\DOMException $e) {
43 43
             if ($throwExceptions) {
44 44
                 throw new \RuntimeException($e->getMessage());
45 45
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
                     throw new \DomException($error->message . ' at line ' . $error->line);
39 39
                 }
40 40
             }
41
-        }
42
-        catch(\DOMException $e) {
41
+        } catch(\DOMException $e) {
43 42
             if ($throwExceptions) {
44 43
                 throw new \RuntimeException($e->getMessage());
45 44
             }
Please login to merge, or discard this patch.
www/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.