@@ -51,7 +51,6 @@ |
||
51 | 51 | /** |
52 | 52 | * Transforms an array of flagged enums to single flagged enumeration instance. |
53 | 53 | * |
54 | - * @param int[] $values bit flags |
|
55 | 54 | * |
56 | 55 | * @throws TransformationFailedException When the transformation fails |
57 | 56 | * |
@@ -111,7 +111,7 @@ |
||
111 | 111 | */ |
112 | 112 | public static function instances(): array |
113 | 113 | { |
114 | - return array_map(function ($value) { |
|
114 | + return array_map(function($value) { |
|
115 | 115 | return static::create($value); |
116 | 116 | }, static::values()); |
117 | 117 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | )); |
39 | 39 | } |
40 | 40 | |
41 | - return array_map(function ($flag) { |
|
41 | + return array_map(function($flag) { |
|
42 | 42 | return $this->createEnum($flag); |
43 | 43 | }, $value->getFlags()); |
44 | 44 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $resolver |
46 | 46 | ->setDefault('multiple', true) |
47 | - ->setAllowedValues('enum_class', function ($value) { |
|
47 | + ->setAllowedValues('enum_class', function($value) { |
|
48 | 48 | return is_a($value, FlaggedEnum::class, true); |
49 | 49 | }) |
50 | 50 | ; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $resolver |
28 | 28 | ->setDefaults([ |
29 | - 'choices' => function (Options $options) { |
|
29 | + 'choices' => function(Options $options) { |
|
30 | 30 | $enumClass = $options['enum_class']; |
31 | 31 | |
32 | 32 | if (!$options['as_value']) { |
@@ -46,21 +46,21 @@ discard block |
||
46 | 46 | |
47 | 47 | return $choices; |
48 | 48 | }, |
49 | - 'choice_label' => function (Options $options) { |
|
49 | + 'choice_label' => function(Options $options) { |
|
50 | 50 | if ($options['as_value']) { |
51 | 51 | return null; |
52 | 52 | } |
53 | 53 | |
54 | 54 | return $this->isReadable($options['enum_class']) ? 'readable' : 'value'; |
55 | 55 | }, |
56 | - 'choice_value' => function (Options $options) { |
|
56 | + 'choice_value' => function(Options $options) { |
|
57 | 57 | return $options['as_value'] ? null : 'value'; |
58 | 58 | }, |
59 | 59 | // If true, will accept and return the enum value instead of object: |
60 | 60 | 'as_value' => false, |
61 | 61 | ]) |
62 | 62 | ->setRequired('enum_class') |
63 | - ->setAllowedValues('enum_class', function ($value) { |
|
63 | + ->setAllowedValues('enum_class', function($value) { |
|
64 | 64 | return is_a($value, EnumInterface::class, true); |
65 | 65 | }) |
66 | 66 | ; |