@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->exclusiveMinimum = $match[2] == '<'; |
| 83 | - $this->minimum = $match[3] === '' ? null : (int)$match[3]; |
|
| 84 | - $this->maximum = $match[4] === '' ? null : (int)$match[4]; |
|
| 83 | + $this->minimum = $match[3] === '' ? null : (int) $match[3]; |
|
| 84 | + $this->maximum = $match[4] === '' ? null : (int) $match[4]; |
|
| 85 | 85 | $this->exclusiveMaximum = isset($match[5]) ? ($match[5] == '>') : null; |
| 86 | 86 | if ($this->minimum && $this->maximum && $this->minimum > $this->maximum) { |
| 87 | 87 | self::swap($this->minimum, $this->maximum); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | return $this; |
| 126 | 126 | |
| 127 | 127 | case 'step': |
| 128 | - if (($step = (int)$data) > 0) { |
|
| 128 | + if (($step = (int) $data) > 0) { |
|
| 129 | 129 | $this->multipleOf = $step; |
| 130 | 130 | } |
| 131 | 131 | return $this; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - return (int)$value; |
|
| 177 | + return (int) $value; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | } |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $exclusiveMinimum = $match[3] == '<'; |
| 107 | - $this->minItems = $match[4] === '' ? null : (int)$match[4]; |
|
| 108 | - $this->maxItems = $match[5] === '' ? null : (int)$match[5]; |
|
| 107 | + $this->minItems = $match[4] === '' ? null : (int) $match[4]; |
|
| 108 | + $this->maxItems = $match[5] === '' ? null : (int) $match[5]; |
|
| 109 | 109 | $exclusiveMaximum = isset($match[6]) ? ($match[6] == '>') : null; |
| 110 | 110 | if ($this->minItems && $this->maxItems && $this->minItems > $this->maxItems) { |
| 111 | 111 | self::swap($this->minItems, $this->maxItems); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | switch (strtolower($command)) { |
| 141 | 141 | case 'min': |
| 142 | - $this->minItems = (int)$data; |
|
| 142 | + $this->minItems = (int) $data; |
|
| 143 | 143 | if ($this->minItems < 0) { |
| 144 | 144 | throw new Exception("Minimum less than zero: '{$data}'"); |
| 145 | 145 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | return $this; |
| 150 | 150 | |
| 151 | 151 | case 'max': |
| 152 | - $this->maxItems = (int)$data; |
|
| 152 | + $this->maxItems = (int) $data; |
|
| 153 | 153 | if ($this->minItems !== null && $this->minItems > $this->maxItems) { |
| 154 | 154 | throw new Exception("Maximum less than minimum: '{$data}'"); |
| 155 | 155 | } |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $exclusiveMinimum = $match[3] == '<'; |
| 146 | - $this->minProperties = $match[4] === '' ? null : (int)$match[4]; |
|
| 147 | - $this->maxProperties = $match[5] === '' ? null : (int)$match[5]; |
|
| 146 | + $this->minProperties = $match[4] === '' ? null : (int) $match[4]; |
|
| 147 | + $this->maxProperties = $match[5] === '' ? null : (int) $match[5]; |
|
| 148 | 148 | $exclusiveMaximum = isset($match[6]) ? ($match[6] == '>') : null; |
| 149 | 149 | if ($this->minProperties && $this->maxProperties && $this->minProperties > $this->maxProperties) { |
| 150 | 150 | self::swap($this->minProperties, $this->maxProperties); |
@@ -250,18 +250,18 @@ discard block |
||
| 250 | 250 | return $this; |
| 251 | 251 | |
| 252 | 252 | case 'min': |
| 253 | - $this->minProperties = (int)$data; |
|
| 253 | + $this->minProperties = (int) $data; |
|
| 254 | 254 | if ($this->minProperties < 0) { |
| 255 | 255 | throw new Exception("Minimum less than zero: '{$data}'"); |
| 256 | 256 | } |
| 257 | 257 | if ($this->maxProperties !== null && $this->minProperties > $this->maxProperties) { |
| 258 | 258 | throw new Exception("Minimum greater than maximum: '{$data}'"); |
| 259 | 259 | } |
| 260 | - $this->minProperties = (int)$data; |
|
| 260 | + $this->minProperties = (int) $data; |
|
| 261 | 261 | return $this; |
| 262 | 262 | |
| 263 | 263 | case 'max': |
| 264 | - $this->maxProperties = (int)$data; |
|
| 264 | + $this->maxProperties = (int) $data; |
|
| 265 | 265 | if ($this->minProperties !== null && $this->minProperties > $this->maxProperties) { |
| 266 | 266 | throw new Exception("Maximum less than minimum: '{$data}'"); |
| 267 | 267 | } |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | if ($data === '') { |
| 143 | 143 | throw new Exception("Missing content for type example"); |
| 144 | 144 | } |
| 145 | - $json = preg_replace_callback('/([^{}:,]+)/', static function ($match) { |
|
| 145 | + $json = preg_replace_callback('/([^{}:,]+)/', static function($match) { |
|
| 146 | 146 | json_decode($match[1]); |
| 147 | 147 | return json_last_error() === JSON_ERROR_NONE ? $match[1] : json_encode($match[1]); |
| 148 | 148 | }, trim($data)); |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $this->exclusiveMinimum = $match[2] == '<'; |
| 75 | - $this->minimum = $match[3] === '' ? null : (float)$match[3]; |
|
| 76 | - $this->maximum = $match[4] === '' ? null : (float)$match[4]; |
|
| 75 | + $this->minimum = $match[3] === '' ? null : (float) $match[3]; |
|
| 76 | + $this->maximum = $match[4] === '' ? null : (float) $match[4]; |
|
| 77 | 77 | $this->exclusiveMaximum = isset($match[5]) ? ($match[5] == '>') : null; |
| 78 | 78 | if ($this->minimum && $this->maximum && $this->minimum > $this->maximum) { |
| 79 | 79 | self::swap($this->minimum, $this->maximum); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | return $this; |
| 117 | 117 | |
| 118 | 118 | case 'step': |
| 119 | - if (($step = (float)$data) > 0) { |
|
| 119 | + if (($step = (float) $data) > 0) { |
|
| 120 | 120 | $this->multipleOf = $step; |
| 121 | 121 | } |
| 122 | 122 | return $this; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - return (float)$value; |
|
| 168 | + return (float) $value; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | } |
@@ -156,8 +156,8 @@ |
||
| 156 | 156 | 'format' => empty($this->format) ? null : $this->format, |
| 157 | 157 | 'pattern' => $this->pattern, |
| 158 | 158 | 'default' => $this->default, |
| 159 | - 'minLength' => $this->minLength ? (int)$this->minLength : null, |
|
| 160 | - 'maxLength' => $this->maxLength ? (int)$this->maxLength : null, |
|
| 159 | + 'minLength' => $this->minLength ? (int) $this->minLength : null, |
|
| 160 | + 'maxLength' => $this->maxLength ? (int) $this->maxLength : null, |
|
| 161 | 161 | 'enum' => $this->enum, |
| 162 | 162 | ), parent::toArray())); |
| 163 | 163 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public static function arrayFilterNull($array): array |
| 135 | 135 | { |
| 136 | - return array_filter($array, static function ($value) { |
|
| 136 | + return array_filter($array, static function($value) { |
|
| 137 | 137 | return $value !== null && $value !== array(); |
| 138 | 138 | }); |
| 139 | 139 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public static function objectsToArray($array): array |
| 147 | 147 | { |
| 148 | - return array_map(static function (AbstractObject $item) { |
|
| 148 | + return array_map(static function(AbstractObject $item) { |
|
| 149 | 149 | return $item->toArray(); |
| 150 | 150 | }, $array); |
| 151 | 151 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | static $lookup = null; |
| 97 | 97 | |
| 98 | 98 | if (is_numeric($search)) { |
| 99 | - return (int)$search; |
|
| 99 | + return (int) $search; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // build static lookup table |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | if ($data === '') { |
| 164 | 164 | throw new Exception('Missing content for example `' . $name . '`'); |
| 165 | 165 | } |
| 166 | - $json = preg_replace_callback('/([^{}:]+)/', static function ($match) { |
|
| 166 | + $json = preg_replace_callback('/([^{}:]+)/', static function($match) { |
|
| 167 | 167 | json_decode($match[1]); |
| 168 | 168 | return json_last_error() === JSON_ERROR_NONE ? $match[1] : json_encode($match[1]); |
| 169 | 169 | }, trim($data)); |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | public function toArray(): array |
| 83 | 83 | { |
| 84 | 84 | $methods = self::$methods; |
| 85 | - uksort($this->operations, static function ($a, $b) use ($methods) { |
|
| 85 | + uksort($this->operations, static function($a, $b) use ($methods) { |
|
| 86 | 86 | return array_search($a, $methods) - array_search($b, $methods); |
| 87 | 87 | }); |
| 88 | 88 | |