@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ParserFunction extends AbstractEntity |
| 17 | 17 | { |
| 18 | - public string|null $name = null; |
|
| 18 | + public string | null $name = null; |
|
| 19 | 19 | |
| 20 | 20 | public function __construct(Parser $Parser, &$tokens, array $statements = null) |
| 21 | 21 | { |
@@ -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, true) - array_search($b, $methods, true); |
| 87 | 87 | }); |
| 88 | 88 | |
@@ -120,18 +120,18 @@ discard block |
||
| 120 | 120 | return $this; |
| 121 | 121 | |
| 122 | 122 | case 'min': |
| 123 | - $this->minProperties = (int)$data; |
|
| 123 | + $this->minProperties = (int) $data; |
|
| 124 | 124 | if ($this->minProperties < 0) { |
| 125 | 125 | throw new Exception("Minimum less than zero: '{$data}'"); |
| 126 | 126 | } |
| 127 | 127 | if ($this->maxProperties !== null && $this->minProperties > $this->maxProperties) { |
| 128 | 128 | throw new Exception("Minimum greater than maximum: '{$data}'"); |
| 129 | 129 | } |
| 130 | - $this->minProperties = (int)$data; |
|
| 130 | + $this->minProperties = (int) $data; |
|
| 131 | 131 | return $this; |
| 132 | 132 | |
| 133 | 133 | case 'max': |
| 134 | - $this->maxProperties = (int)$data; |
|
| 134 | + $this->maxProperties = (int) $data; |
|
| 135 | 135 | if ($this->minProperties !== null && $this->minProperties > $this->maxProperties) { |
| 136 | 136 | throw new Exception("Maximum less than minimum: '{$data}'"); |
| 137 | 137 | } |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | $exclusiveMinimum = $match[3] === '<'; |
| 288 | - $this->minProperties = $match[4] === '' ? null : (int)$match[4]; |
|
| 289 | - $this->maxProperties = $match[5] === '' ? null : (int)$match[5]; |
|
| 288 | + $this->minProperties = $match[4] === '' ? null : (int) $match[4]; |
|
| 289 | + $this->maxProperties = $match[5] === '' ? null : (int) $match[5]; |
|
| 290 | 290 | $exclusiveMaximum = isset($match[6]) ? ($match[6] === '>') : null; |
| 291 | 291 | if ($this->minProperties && $this->maxProperties && $this->minProperties > $this->maxProperties) { |
| 292 | 292 | self::swap($this->minProperties, $this->maxProperties); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $consumes = $this->getSwagger()->getConsumes(); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $valid_consumes = ((int)in_array('multipart/form-data', $consumes, true)) + ((int)in_array('application/x-www-form-urlencoded', $consumes, true)); |
|
| 55 | + $valid_consumes = ((int) in_array('multipart/form-data', $consumes, true)) + ((int) in_array('application/x-www-form-urlencoded', $consumes, true)); |
|
| 56 | 56 | if (empty($consumes) || $valid_consumes !== count($consumes)) { |
| 57 | 57 | throw new Exception("File type '{$definition}' without valid consume"); |
| 58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return $this; |
| 62 | 62 | |
| 63 | 63 | case 'step': |
| 64 | - if (($step = (int)$data) > 0) { |
|
| 64 | + if (($step = (int) $data) > 0) { |
|
| 65 | 65 | $this->multipleOf = $step; |
| 66 | 66 | } |
| 67 | 67 | return $this; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - return (int)$value; |
|
| 93 | + return (int) $value; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | public function toArray(): array |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $this->exclusiveMinimum = $match[2] === '<'; |
| 160 | - $this->minimum = $match[3] === '' ? null : (int)$match[3]; |
|
| 161 | - $this->maximum = $match[4] === '' ? null : (int)$match[4]; |
|
| 160 | + $this->minimum = $match[3] === '' ? null : (int) $match[3]; |
|
| 161 | + $this->maximum = $match[4] === '' ? null : (int) $match[4]; |
|
| 162 | 162 | $this->exclusiveMaximum = isset($match[5]) ? ($match[5] === '>') : null; |
| 163 | 163 | if ($this->minimum && $this->maximum && $this->minimum > $this->maximum) { |
| 164 | 164 | self::swap($this->minimum, $this->maximum); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | return $this; |
| 59 | 59 | |
| 60 | 60 | case 'step': |
| 61 | - if (($step = (float)$data) > 0) { |
|
| 61 | + if (($step = (float) $data) > 0) { |
|
| 62 | 62 | $this->multipleOf = $step; |
| 63 | 63 | } |
| 64 | 64 | return $this; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - return (float)$value; |
|
| 90 | + return (float) $value; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | public function toArray(): array |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $this->exclusiveMinimum = $match[2] === '<'; |
| 152 | - $this->minimum = $match[3] === '' ? null : (float)$match[3]; |
|
| 153 | - $this->maximum = $match[4] === '' ? null : (float)$match[4]; |
|
| 152 | + $this->minimum = $match[3] === '' ? null : (float) $match[3]; |
|
| 153 | + $this->maximum = $match[4] === '' ? null : (float) $match[4]; |
|
| 154 | 154 | $this->exclusiveMaximum = isset($match[5]) ? ($match[5] === '>') : null; |
| 155 | 155 | if ($this->minimum && $this->maximum && $this->minimum > $this->maximum) { |
| 156 | 156 | self::swap($this->minimum, $this->maximum); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | switch (strtolower($command)) { |
| 61 | 61 | case 'min': |
| 62 | - $this->minItems = (int)$data; |
|
| 62 | + $this->minItems = (int) $data; |
|
| 63 | 63 | if ($this->minItems < 0) { |
| 64 | 64 | throw new Exception("Minimum less than zero: '$data'"); |
| 65 | 65 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | return $this; |
| 70 | 70 | |
| 71 | 71 | case 'max': |
| 72 | - $this->maxItems = (int)$data; |
|
| 72 | + $this->maxItems = (int) $data; |
|
| 73 | 73 | if ($this->minItems !== null && $this->minItems > $this->maxItems) { |
| 74 | 74 | throw new Exception("Maximum less than minimum: '$data'"); |
| 75 | 75 | } |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $exclusiveMinimum = $match[3] === '<'; |
| 185 | - $this->minItems = $match[4] === '' ? null : (int)$match[4]; |
|
| 186 | - $this->maxItems = $match[5] === '' ? null : (int)$match[5]; |
|
| 185 | + $this->minItems = $match[4] === '' ? null : (int) $match[4]; |
|
| 186 | + $this->maxItems = $match[5] === '' ? null : (int) $match[5]; |
|
| 187 | 187 | $exclusiveMaximum = isset($match[6]) ? ($match[6] === '>') : null; |
| 188 | 188 | if ($this->minItems && $this->maxItems && $this->minItems > $this->maxItems) { |
| 189 | 189 | self::swap($this->minItems, $this->maxItems); |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | 'termsOfService' => $this->termsofservice, |
| 108 | 108 | 'contact' => $this->contact?->toArray(), |
| 109 | 109 | 'license' => $this->license?->toArray(), |
| 110 | - 'version' => (string)$this->version, |
|
| 110 | + 'version' => (string) $this->version, |
|
| 111 | 111 | ), parent::toArray())); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | * @copyright 2014-2025 Martijn van der Lee |
| 13 | 13 | * @license https://opensource.org/licenses/MIT MIT |
| 14 | 14 | */ |
| 15 | -class TypeRegistry |
|
| 16 | -{
|
|
| 15 | +class TypeRegistry |
|
| 16 | +{ |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Map of format-name => class-name |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function add(string $classname): void |
| 31 | 31 | {
|
| 32 | - if (is_subclass_of($classname, ICustomType::class)) {
|
|
| 33 | - foreach ($classname::getFormats() as $format) {
|
|
| 32 | + if (is_subclass_of($classname, ICustomType::class)) { |
|
| 33 | + foreach ($classname::getFormats() as $format) { |
|
| 34 | 34 | $this->formats[$format] = $classname; |
| 35 | 35 | } |
| 36 | 36 | } |