@@ -126,7 +126,7 @@ |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | if (is_array($data)) { |
129 | - return array_map(function ($data) use ($excludedKeys) { |
|
129 | + return array_map(function($data) use ($excludedKeys) { |
|
130 | 130 | return $this->excludeKeys($data, $excludedKeys); |
131 | 131 | }, $data); |
132 | 132 | } |
@@ -118,7 +118,9 @@ |
||
118 | 118 | if (is_object($data)) { |
119 | 119 | $object = new \stdClass(); |
120 | 120 | foreach (get_object_vars($data) as $key => $value) { |
121 | - if (in_array($key, $excludedKeys)) continue; |
|
121 | + if (in_array($key, $excludedKeys)) { |
|
122 | + continue; |
|
123 | + } |
|
122 | 124 | $object->$key = $this->excludeKeys($value, $excludedKeys); |
123 | 125 | } |
124 | 126 |
@@ -102,11 +102,11 @@ |
||
102 | 102 | { |
103 | 103 | // get base path |
104 | 104 | $basePath = $this->getPath($options); |
105 | - $path = ltrim($basePath . '/' . $path, '/'); |
|
105 | + $path = ltrim($basePath.'/'.$path, '/'); |
|
106 | 106 | $pathExists = true; |
107 | 107 | try { |
108 | 108 | $this->jsonHelper->parse($this->subject, $path); |
109 | - } catch(MissingPathException $e){ |
|
109 | + } catch (MissingPathException $e) { |
|
110 | 110 | $pathExists = false; |
111 | 111 | |
112 | 112 | } |
@@ -6,7 +6,6 @@ |
||
6 | 6 | use JsonSchema\Uri\Retrievers\PredefinedArray; |
7 | 7 | use JsonSchema\Uri\UriResolver; |
8 | 8 | use JsonSchema\Uri\UriRetriever; |
9 | -use JsonSchema\Validator; |
|
10 | 9 | |
11 | 10 | /** |
12 | 11 | * Simplify usage of justinrainbow/json-schema |
@@ -112,6 +112,9 @@ |
||
112 | 112 | return $type; |
113 | 113 | } |
114 | 114 | |
115 | + /** |
|
116 | + * @param string $type |
|
117 | + */ |
|
115 | 118 | function parseTypeExpression($type) |
116 | 119 | { |
117 | 120 | $rpn = $this->rpn($type); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | if (isset($definition['oneOf'])) { |
27 | - $definition['oneOf'] = array_map(function ($type) { |
|
27 | + $definition['oneOf'] = array_map(function($type) { |
|
28 | 28 | return $this->processTypeDeclaration($type); |
29 | 29 | }, $definition['oneOf']); |
30 | 30 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | $obj['properties'] = $this->expandProperties($obj['properties']); |
68 | 68 | // todo: support pattern properties |
69 | - $obj['required'] = array_keys(array_filter($obj['properties'], function ($type) { |
|
69 | + $obj['required'] = array_keys(array_filter($obj['properties'], function($type) { |
|
70 | 70 | return array_key_exists('_required', $type) ? $type['_required'] : true; |
71 | 71 | })); |
72 | 72 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | private function stripInternalRequiredKey(array $type) |
97 | 97 | { |
98 | 98 | if ('object' === $type['type']) { |
99 | - $type['properties'] = array_map(function ($type) { |
|
99 | + $type['properties'] = array_map(function($type) { |
|
100 | 100 | return $this->stripInternalRequiredKey($type); |
101 | 101 | }, $type['properties']); |
102 | 102 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | foreach ($rpn as $token) { |
121 | 121 | switch ($token) { |
122 | 122 | case '|': |
123 | - $operands = [array_pop($stack), array_pop($stack)];; |
|
123 | + $operands = [array_pop($stack), array_pop($stack)]; ; |
|
124 | 124 | if (isset($operands[0]['oneOf'])) { |
125 | 125 | $operands[0]['oneOf'][] = $operands[1]; |
126 | 126 | $union = $operands[0]; |