Completed
Branch master (c612ec)
by Alexpts
06:47
created
Category
src/PTS/Codeception/JsonSchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             $this->validator->setBaseUri($this->config['baseUri']);
32 32
         }
33 33
 
34
-        $schemasDir = realpath(Configuration::testsDir() . '/' . $this->config['schemaDir']);
34
+        $schemasDir = realpath(Configuration::testsDir().'/'.$this->config['schemaDir']);
35 35
         $this->validator->loadAllSchemas($schemasDir);
36 36
     }
37 37
 
Please login to merge, or discard this patch.
src/PTS/JsonSchema.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function __construct()
24 24
     {
25 25
         $this->schemaStorage = new SchemaStorage;
26
-        $this->validator = new Validator( new Factory($this->schemaStorage));
26
+        $this->validator = new Validator(new Factory($this->schemaStorage));
27 27
     }
28 28
 
29 29
     public function setBaseUri(string $baseUri = 'http://demo.org'): void
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         foreach (new RecursiveIteratorIterator($iterator) as $path) {
45 45
             $relPath = str_replace($schemaDir, '', $path);
46 46
             $schema = json_decode(file_get_contents($path));
47
-            $this->schemaStorage->addSchema($this->baseUri . $relPath, $schema);
47
+            $this->schemaStorage->addSchema($this->baseUri.$relPath, $schema);
48 48
         }
49 49
     }
50 50
 
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 
60 60
     public function resolveSchemaByPath(string $path): \stdClass
61 61
     {
62
-        return $this->schemaStorage->getSchema($this->baseUri . $path);
62
+        return $this->schemaStorage->getSchema($this->baseUri.$path);
63 63
     }
64 64
 
65
-    public function validateJsonSchema(string $response, string $pathSchema): ?string
65
+    public function validateJsonSchema(string $response, string $pathSchema): ? string
66 66
     {
67 67
         $responseData = json_decode($response);
68 68
         $schema = $this->resolveSchemaByPath($pathSchema);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         return $this->getErrorMessage($isValid);
75 75
     }
76 76
 
77
-    protected function getErrorMessage(bool $isValid): ?string
77
+    protected function getErrorMessage(bool $isValid): ? string
78 78
     {
79 79
         if ($isValid) {
80 80
             return null;
Please login to merge, or discard this patch.