@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | foreach ($reflectionMethod->getParameters() as $parameter) { |
| 103 | 103 | $parameterType = $parameter->getClass(); |
| 104 | - if (! is_null($parameterType) && class_exists($parameterType->name)) { |
|
| 104 | + if (!is_null($parameterType) && class_exists($parameterType->name)) { |
|
| 105 | 105 | $className = $parameterType->name; |
| 106 | 106 | $parameterReflection = new $className; |
| 107 | 107 | if ($parameterReflection instanceof FormRequest) { |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | protected function fancyImplode($arr, $first, $last) |
| 128 | 128 | { |
| 129 | - $arr = array_map(function ($value) { |
|
| 130 | - return '`'.$value.'`'; |
|
| 129 | + $arr = array_map(function($value) { |
|
| 130 | + return '`' . $value . '`'; |
|
| 131 | 131 | }, $arr); |
| 132 | 132 | array_push($arr, implode($last, array_splice($arr, -2))); |
| 133 | 133 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | break; |
| 160 | 160 | case 'after': |
| 161 | 161 | $attributeData['type'] = 'date'; |
| 162 | - $attributeData['description'][] = 'Must be a date after: `'.date(DATE_RFC850, strtotime($parameters[0])).'`'; |
|
| 162 | + $attributeData['description'][] = 'Must be a date after: `' . date(DATE_RFC850, strtotime($parameters[0])) . '`'; |
|
| 163 | 163 | $attributeData['value'] = date(DATE_RFC850, strtotime('+1 day', strtotime($parameters[0]))); |
| 164 | 164 | break; |
| 165 | 165 | case 'alpha': |
@@ -177,40 +177,40 @@ discard block |
||
| 177 | 177 | $attributeData['value'] = $faker->randomElement($parameters); |
| 178 | 178 | break; |
| 179 | 179 | case 'not_in': |
| 180 | - $attributeData['description'][] = 'Not in: '.$this->fancyImplode($parameters, ', ', ' or '); |
|
| 180 | + $attributeData['description'][] = 'Not in: ' . $this->fancyImplode($parameters, ', ', ' or '); |
|
| 181 | 181 | $attributeData['value'] = $faker->word; |
| 182 | 182 | break; |
| 183 | 183 | case 'min': |
| 184 | - $attributeData['description'][] = 'Minimum: `'.$parameters[0].'`'; |
|
| 184 | + $attributeData['description'][] = 'Minimum: `' . $parameters[0] . '`'; |
|
| 185 | 185 | break; |
| 186 | 186 | case 'max': |
| 187 | - $attributeData['description'][] = 'Maximum: `'.$parameters[0].'`'; |
|
| 187 | + $attributeData['description'][] = 'Maximum: `' . $parameters[0] . '`'; |
|
| 188 | 188 | break; |
| 189 | 189 | case 'between': |
| 190 | 190 | $attributeData['type'] = 'numeric'; |
| 191 | - $attributeData['description'][] = 'Between: `'.$parameters[0].'` and `'.$parameters[1].'`'; |
|
| 191 | + $attributeData['description'][] = 'Between: `' . $parameters[0] . '` and `' . $parameters[1] . '`'; |
|
| 192 | 192 | $attributeData['value'] = $faker->numberBetween($parameters[0], $parameters[1]); |
| 193 | 193 | break; |
| 194 | 194 | case 'before': |
| 195 | 195 | $attributeData['type'] = 'date'; |
| 196 | - $attributeData['description'][] = 'Must be a date preceding: `'.date(DATE_RFC850, strtotime($parameters[0])).'`'; |
|
| 196 | + $attributeData['description'][] = 'Must be a date preceding: `' . date(DATE_RFC850, strtotime($parameters[0])) . '`'; |
|
| 197 | 197 | $attributeData['value'] = date(DATE_RFC850, strtotime('-1 day', strtotime($parameters[0]))); |
| 198 | 198 | break; |
| 199 | 199 | case 'date_format': |
| 200 | 200 | $attributeData['type'] = 'date'; |
| 201 | - $attributeData['description'][] = 'Date format: `'.$parameters[0].'`'; |
|
| 201 | + $attributeData['description'][] = 'Date format: `' . $parameters[0] . '`'; |
|
| 202 | 202 | break; |
| 203 | 203 | case 'different': |
| 204 | - $attributeData['description'][] = 'Must have a different value than parameter: `'.$parameters[0].'`'; |
|
| 204 | + $attributeData['description'][] = 'Must have a different value than parameter: `' . $parameters[0] . '`'; |
|
| 205 | 205 | break; |
| 206 | 206 | case 'digits': |
| 207 | 207 | $attributeData['type'] = 'numeric'; |
| 208 | - $attributeData['description'][] = 'Must have an exact length of `'.$parameters[0].'`'; |
|
| 208 | + $attributeData['description'][] = 'Must have an exact length of `' . $parameters[0] . '`'; |
|
| 209 | 209 | $attributeData['value'] = $faker->randomNumber($parameters[0], true); |
| 210 | 210 | break; |
| 211 | 211 | case 'digits_between': |
| 212 | 212 | $attributeData['type'] = 'numeric'; |
| 213 | - $attributeData['description'][] = 'Must have a length between `'.$parameters[0].'` and `'.$parameters[1].'`'; |
|
| 213 | + $attributeData['description'][] = 'Must have a length between `' . $parameters[0] . '` and `' . $parameters[1] . '`'; |
|
| 214 | 214 | break; |
| 215 | 215 | case 'image': |
| 216 | 216 | $attributeData['type'] = 'image'; |
@@ -223,38 +223,38 @@ discard block |
||
| 223 | 223 | break; |
| 224 | 224 | case 'mimetypes': |
| 225 | 225 | case 'mimes': |
| 226 | - $attributeData['description'][] = 'Allowed mime types: '.$this->fancyImplode($parameters, ', ', ' or '); |
|
| 226 | + $attributeData['description'][] = 'Allowed mime types: ' . $this->fancyImplode($parameters, ', ', ' or '); |
|
| 227 | 227 | break; |
| 228 | 228 | case 'required_if': |
| 229 | - $attributeData['description'][] = 'Required if `'.$parameters[0].'` is `'.$parameters[1].'`'; |
|
| 229 | + $attributeData['description'][] = 'Required if `' . $parameters[0] . '` is `' . $parameters[1] . '`'; |
|
| 230 | 230 | break; |
| 231 | 231 | case 'required_unless': |
| 232 | - $attributeData['description'][] = 'Required unless `'.$parameters[0].'` is `'.$parameters[1].'`'; |
|
| 232 | + $attributeData['description'][] = 'Required unless `' . $parameters[0] . '` is `' . $parameters[1] . '`'; |
|
| 233 | 233 | break; |
| 234 | 234 | case 'required_with': |
| 235 | - $attributeData['description'][] = 'Required if the parameters '.$this->fancyImplode($parameters, ', ', ' or ').' are present.'; |
|
| 235 | + $attributeData['description'][] = 'Required if the parameters ' . $this->fancyImplode($parameters, ', ', ' or ') . ' are present.'; |
|
| 236 | 236 | break; |
| 237 | 237 | case 'required_with_all': |
| 238 | - $attributeData['description'][] = 'Required if the parameters '.$this->fancyImplode($parameters, ', ', ' and ').' are present.'; |
|
| 238 | + $attributeData['description'][] = 'Required if the parameters ' . $this->fancyImplode($parameters, ', ', ' and ') . ' are present.'; |
|
| 239 | 239 | break; |
| 240 | 240 | case 'required_without': |
| 241 | - $attributeData['description'][] = 'Required if the parameters '.$this->fancyImplode($parameters, ', ', ' or ').' are not present.'; |
|
| 241 | + $attributeData['description'][] = 'Required if the parameters ' . $this->fancyImplode($parameters, ', ', ' or ') . ' are not present.'; |
|
| 242 | 242 | break; |
| 243 | 243 | case 'required_without_all': |
| 244 | - $attributeData['description'][] = 'Required if the parameters '.$this->fancyImplode($parameters, ', ', ' and ').' are not present.'; |
|
| 244 | + $attributeData['description'][] = 'Required if the parameters ' . $this->fancyImplode($parameters, ', ', ' and ') . ' are not present.'; |
|
| 245 | 245 | break; |
| 246 | 246 | case 'same': |
| 247 | - $attributeData['description'][] = 'Must be the same as `'.$parameters[0].'`'; |
|
| 247 | + $attributeData['description'][] = 'Must be the same as `' . $parameters[0] . '`'; |
|
| 248 | 248 | break; |
| 249 | 249 | case 'size': |
| 250 | - $attributeData['description'][] = 'Must have the size of `'.$parameters[0].'`'; |
|
| 250 | + $attributeData['description'][] = 'Must have the size of `' . $parameters[0] . '`'; |
|
| 251 | 251 | break; |
| 252 | 252 | case 'timezone': |
| 253 | 253 | $attributeData['description'][] = 'Must be a valid timezone identifier'; |
| 254 | 254 | $attributeData['value'] = $faker->timezone; |
| 255 | 255 | break; |
| 256 | 256 | case 'exists': |
| 257 | - $attributeData['description'][] = 'Valid '.Str::singular($parameters[0]).' '.$parameters[1]; |
|
| 257 | + $attributeData['description'][] = 'Valid ' . Str::singular($parameters[0]) . ' ' . $parameters[1]; |
|
| 258 | 258 | break; |
| 259 | 259 | case 'active_url': |
| 260 | 260 | $attributeData['type'] = 'url'; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | break; |
| 263 | 263 | case 'regex': |
| 264 | 264 | $attributeData['type'] = 'string'; |
| 265 | - $attributeData['description'][] = 'Must match this regular expression: `'.$parameters[0].'`'; |
|
| 265 | + $attributeData['description'][] = 'Must match this regular expression: `' . $parameters[0] . '`'; |
|
| 266 | 266 | break; |
| 267 | 267 | case 'boolean': |
| 268 | 268 | $attributeData['value'] = true; |
@@ -357,8 +357,8 @@ discard block |
||
| 357 | 357 | foreach ($headers as $name => $value) { |
| 358 | 358 | $name = strtr(strtoupper($name), '-', '_'); |
| 359 | 359 | |
| 360 | - if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
| 361 | - $name = $prefix.$name; |
|
| 360 | + if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
| 361 | + $name = $prefix . $name; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | $server[$name] = $value; |