Completed
Pull Request — master (#16)
by Sergey
10:16
created
src/Helper/JsonHelper.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,9 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/JsonMatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,11 +102,11 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/functions.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/JsonSchema/JsonSchemaGenerator.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -112,6 +112,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.