@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function transformEnums(): Closure |
| 21 | 21 | { |
| 22 | - return function (array $transformations): void { |
|
| 22 | + return function(array $transformations): void { |
|
| 23 | 23 | if (isset($transformations[EnumRequest::REQUEST_ROUTE])) { |
| 24 | 24 | $route = $this->route(); |
| 25 | 25 | |
| 26 | 26 | /** @var string|Enum $enumClass */ |
| 27 | 27 | foreach ($transformations[EnumRequest::REQUEST_ROUTE] as $key => $enumClass) { |
| 28 | - if (! $route->hasParameter($key)) { |
|
| 28 | + if (!$route->hasParameter($key)) { |
|
| 29 | 29 | continue; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | if (isset($transformations[EnumRequest::REQUEST_QUERY])) { |
| 40 | 40 | /** @var string|Enum $enumClass */ |
| 41 | 41 | foreach ($transformations[EnumRequest::REQUEST_QUERY] as $key => $enumClass) { |
| 42 | - if (! $this->query->has($key)) { |
|
| 42 | + if (!$this->query->has($key)) { |
|
| 43 | 43 | continue; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | if (isset($transformations[EnumRequest::REQUEST_REQUEST])) { |
| 54 | 54 | /** @var string|Enum $enumClass */ |
| 55 | 55 | foreach ($transformations[EnumRequest::REQUEST_REQUEST] as $key => $enumClass) { |
| 56 | - if (! $this->request->has($key)) { |
|
| 56 | + if (!$this->request->has($key)) { |
|
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | /** @var string|Enum $enumClass */ |
| 68 | 68 | foreach (Arr::except($transformations, [EnumRequest::REQUEST_ROUTE, EnumRequest::REQUEST_QUERY, EnumRequest::REQUEST_REQUEST]) as $key => $enumClass) { |
| 69 | - if (! isset($this[$key])) { |
|
| 69 | + if (!isset($this[$key])) { |
|
| 70 | 70 | continue; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | protected function getDisplayableOtherValues(): array |
| 52 | 52 | { |
| 53 | - return array_map(function ($value): string { |
|
| 53 | + return array_map(function($value): string { |
|
| 54 | 54 | return $this->getValueTranslation($value) ?? $value; |
| 55 | 55 | }, $this->getOtherValues()); |
| 56 | 56 | } |
@@ -42,9 +42,9 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $methods = $this->option('method'); |
| 44 | 44 | |
| 45 | - if (! empty($methods)) { |
|
| 45 | + if (!empty($methods)) { |
|
| 46 | 46 | $docBlock = PHP_EOL.'/**'; |
| 47 | - $docBlock .= implode('', array_map(function ($method) { |
|
| 47 | + $docBlock .= implode('', array_map(function($method) { |
|
| 48 | 48 | return PHP_EOL.' * @method static self '.$method.'()'; |
| 49 | 49 | }, $methods)); |
| 50 | 50 | $docBlock .= PHP_EOL.' */'; |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | public function bootValidationRules(): void |
| 45 | 45 | { |
| 46 | - Validator::extend('enum', function (string $attribute, $value, array $parameters, ValidatorContract $validator): bool { |
|
| 46 | + Validator::extend('enum', function(string $attribute, $value, array $parameters, ValidatorContract $validator): bool { |
|
| 47 | 47 | $enum = $parameters[0] ?? null; |
| 48 | 48 | |
| 49 | 49 | return (new EnumRule($enum))->passes($attribute, $value); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function randomEnum(string $enum): Enum |
| 34 | 34 | { |
| 35 | - if (! is_subclass_of($enum, Enum::class)) { |
|
| 35 | + if (!is_subclass_of($enum, Enum::class)) { |
|
| 36 | 36 | throw new InvalidArgumentException(sprintf( |
| 37 | 37 | 'You have to pass the FQCN of a "%s" class but you passed "%s".', |
| 38 | 38 | Enum::class, |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function randomEnumValue(string $enum) |
| 54 | 54 | { |
| 55 | - if (! is_subclass_of($enum, Enum::class)) { |
|
| 55 | + if (!is_subclass_of($enum, Enum::class)) { |
|
| 56 | 56 | throw new InvalidArgumentException(sprintf( |
| 57 | 57 | 'You have to pass the FQCN of a "%s" class but you passed "%s".', |
| 58 | 58 | Enum::class, |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function randomEnumLabel(string $enum): string |
| 74 | 74 | { |
| 75 | - if (! is_subclass_of($enum, Enum::class)) { |
|
| 75 | + if (!is_subclass_of($enum, Enum::class)) { |
|
| 76 | 76 | throw new InvalidArgumentException(sprintf( |
| 77 | 77 | 'You have to pass the FQCN of a "%s" class but you passed "%s".', |
| 78 | 78 | Enum::class, |