@@ -31,7 +31,7 @@ |
||
| 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 | |
@@ -23,7 +23,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |