@@ -45,7 +45,7 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $this->description = $data; |
| 48 | - $this->required = (bool)$required; |
|
| 48 | + $this->required = (bool) $required; |
|
| 49 | 49 | |
| 50 | 50 | $this->schema = new Schema($this, $type); |
| 51 | 51 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $consumes = $this->getSwagger()->getConsumes(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $valid_consumes = ((int)in_array('multipart/form-data', $consumes)) + ((int)in_array('application/x-www-form-urlencoded', $consumes)); |
|
| 43 | + $valid_consumes = ((int) in_array('multipart/form-data', $consumes)) + ((int) in_array('application/x-www-form-urlencoded', $consumes)); |
|
| 44 | 44 | if (empty($consumes) || $valid_consumes !== count($consumes)) { |
| 45 | 45 | throw new Exception("File type '{$definition}' without valid consume"); |
| 46 | 46 | } |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | 'termsOfService' => $this->termsofservice, |
| 108 | 108 | 'contact' => $this->contact ? $this->contact->toArray() : null, |
| 109 | 109 | 'license' => $this->license ? $this->license->toArray() : null, |
| 110 | - 'version' => (string)$this->version, |
|
| 110 | + 'version' => (string) $this->version, |
|
| 111 | 111 | ), parent::toArray())); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -spl_autoload_register(function ($classname) { |
|
| 3 | +spl_autoload_register(function($classname) { |
|
| 4 | 4 | $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php'; |
| 5 | 5 | if (is_file($file)) { |
| 6 | 6 | require_once $file; |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @rest\path Int id The ID of the User |
| 22 | 22 | * @rest\response 200 User |
| 23 | 23 | */ |
| 24 | - $app->get('/v1/users/{id:[0-9]+}', function ($request, $response, $args) { |
|
| 24 | + $app->get('/v1/users/{id:[0-9]+}', function($request, $response, $args) { |
|
| 25 | 25 | // ... |
| 26 | 26 | }); |
| 27 | 27 | } |
@@ -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)); |
@@ -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 | } |
@@ -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 | |