Completed
Pull Request — master (#16)
by Sergey
04:51
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 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -44,6 +44,9 @@
 block discarded – undo
44 44
     
45 45
 }
46 46
 
47
+/**
48
+ * @param string $type
49
+ */
47 50
 function _parseTypeExpression($type)
48 51
 {
49 52
     $rpn = _rpn($type);
Please login to merge, or discard this 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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     foreach ($rpn as $token) {
53 53
         switch ($token) {
54 54
             case '|':
55
-                $operands = [array_pop($stack), array_pop($stack)];;
55
+                $operands = [array_pop($stack), array_pop($stack)]; ;
56 56
                 if (isset($operands[0]['oneOf'])) {
57 57
                     $operands[0]['oneOf'][] = $operands[1];
58 58
                     $union = $operands[0];
Please login to merge, or discard this patch.
src/JsonSchema/JsonSchemaGenerator.php 1 patch
Spacing   +3 added lines, -3 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
         }
Please login to merge, or discard this patch.