@@ -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 | |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $this->name = $name; |
| 97 | 97 | |
| 98 | 98 | $this->description = $data; |
| 99 | - $this->required = (bool)$required; |
|
| 99 | + $this->required = (bool) $required; |
|
| 100 | 100 | |
| 101 | 101 | // Parse regex |
| 102 | 102 | $match = array(); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if ($result !== $top) { |
| 158 | 158 | // Remove all similar classes from array first! |
| 159 | 159 | $classname = get_class($result); |
| 160 | - $stack = array_filter($stack, static function ($class) use ($classname) { |
|
| 160 | + $stack = array_filter($stack, static function($class) use ($classname) { |
|
| 161 | 161 | return !(is_a($class, $classname)); |
| 162 | 162 | }); |
| 163 | 163 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $stacktrace = []; |
| 178 | 178 | foreach ($stack as $object) { |
| 179 | - $stacktrace[] = (string)$object; |
|
| 179 | + $stacktrace[] = (string) $object; |
|
| 180 | 180 | } |
| 181 | 181 | $messages[] = implode(', ' . PHP_EOL, $stacktrace); |
| 182 | 182 | |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | if (!function_exists('yaml_emit')) { |
| 238 | 238 | throw new Exception('YAML extension not installed.'); |
| 239 | 239 | } |
| 240 | - array_walk_recursive($output, static function (&$value) { |
|
| 240 | + array_walk_recursive($output, static function(&$value) { |
|
| 241 | 241 | if (is_object($value)) { |
| 242 | - $value = (array)$value; |
|
| 242 | + $value = (array) $value; |
|
| 243 | 243 | } |
| 244 | 244 | }); |
| 245 | 245 | $output = yaml_emit($output, YAML_UTF8_ENCODING, YAML_LN_BREAK); |