@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | if ($result !== $top) { |
161 | 161 | // Remove all similar classes from array first! |
162 | 162 | $classname = get_class($result); |
163 | - $stack = array_filter($stack, function ($class) use ($classname) { |
|
163 | + $stack = array_filter($stack, function($class) use ($classname) { |
|
164 | 164 | return !(is_a($class, $classname)); |
165 | 165 | }); |
166 | 166 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $stacktrace = []; |
181 | 181 | foreach ($stack as $object) { |
182 | - $stacktrace[] = (string)$object; |
|
182 | + $stacktrace[] = (string) $object; |
|
183 | 183 | } |
184 | 184 | $messages[] = join(', ' . PHP_EOL, $stacktrace); |
185 | 185 | |
@@ -239,9 +239,9 @@ discard block |
||
239 | 239 | if (!function_exists('yaml_emit')) { |
240 | 240 | throw new Exception('YAML extension not installed.'); |
241 | 241 | } |
242 | - array_walk_recursive($output, function (&$value) { |
|
242 | + array_walk_recursive($output, function(&$value) { |
|
243 | 243 | if (is_object($value)) { |
244 | - $value = (array)$value; |
|
244 | + $value = (array) $value; |
|
245 | 245 | } |
246 | 246 | }); |
247 | 247 | $output = yaml_emit($output, YAML_UTF8_ENCODING, YAML_LN_BREAK); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | } |
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(); |
@@ -163,7 +163,7 @@ |
||
163 | 163 | if ($data === '') { |
164 | 164 | throw new Exception('Missing content for example `' . $name . '`'); |
165 | 165 | } |
166 | - $json = preg_replace_callback('/([^{}:]+)/', function ($match) { |
|
166 | + $json = preg_replace_callback('/([^{}:]+)/', 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() |
83 | 83 | { |
84 | 84 | $methods = self::$methods; |
85 | - uksort($this->operations, function ($a, $b) use ($methods) { |
|
85 | + uksort($this->operations, function($a, $b) use ($methods) { |
|
86 | 86 | return array_search($a, $methods) - array_search($b, $methods); |
87 | 87 | }); |
88 | 88 |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public static function arrayFilterNull($array) |
135 | 135 | { |
136 | - return array_filter($array, function ($value) { |
|
136 | + return array_filter($array, 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) |
147 | 147 | { |
148 | - return array_map(function (AbstractObject $item) { |
|
148 | + return array_map(function(AbstractObject $item) { |
|
149 | 149 | return $item->toArray(); |
150 | 150 | }, $array); |
151 | 151 | } |
@@ -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 | } |
@@ -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('/([^{}:,]+)/', function ($match) { |
|
145 | + $json = preg_replace_callback('/([^{}:,]+)/', 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)); |
@@ -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 |