@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | protected function configureOptions(OptionsResolver $resolver) |
53 | 53 | { |
54 | 54 | $resolver->setDefaults([ |
55 | - 'show_prefix' => function (Options $options) { |
|
55 | + 'show_prefix' => function(Options $options) { |
|
56 | 56 | if ($options['measurement_unit'] !== null) { |
57 | 57 | /** @var MeasurementUnit $unit */ |
58 | 58 | $unit = $options['measurement_unit']; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | return false; |
62 | 62 | }, |
63 | - 'is_integer' => function (Options $options) { |
|
63 | + 'is_integer' => function(Options $options) { |
|
64 | 64 | if ($options['measurement_unit'] !== null) { |
65 | 65 | /** @var MeasurementUnit $unit */ |
66 | 66 | $unit = $options['measurement_unit']; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | return true; |
70 | 70 | }, |
71 | - 'unit' => function (Options $options) { |
|
71 | + 'unit' => function(Options $options) { |
|
72 | 72 | if ($options['measurement_unit'] !== null) { |
73 | 73 | /** @var MeasurementUnit $unit */ |
74 | 74 | $unit = $options['measurement_unit']; |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | return ''; |
78 | 78 | }, |
79 | 79 | 'decimals' => 2, |
80 | - 'error_mapping' => [ '.' => 'value'] |
|
80 | + 'error_mapping' => ['.' => 'value'] |
|
81 | 81 | ]); |
82 | 82 | |
83 | 83 | $resolver->setAllowedTypes('decimals', 'int'); |
84 | 84 | |
85 | - $resolver->setNormalizer('decimals', function (Options $options, $value) { |
|
85 | + $resolver->setNormalizer('decimals', function(Options $options, $value) { |
|
86 | 86 | // If the unit is integer based, then dont show any decimals |
87 | 87 | if ($options['is_integer']) { |
88 | 88 | return 0; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | //Otherwise just output it |
127 | - $format_string = '%.' . $options['decimals'] . 'f ' . $options['unit']; |
|
127 | + $format_string = '%.'.$options['decimals'].'f '.$options['unit']; |
|
128 | 128 | return sprintf($format_string, $value); |
129 | 129 | } |
130 | 130 | } |
131 | 131 | \ No newline at end of file |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return "indeterminate"; |
128 | 128 | } |
129 | 129 | |
130 | - throw new \InvalidArgumentException('Invalid value encountered!: ' . $value); |
|
130 | + throw new \InvalidArgumentException('Invalid value encountered!: '.$value); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | case "indeterminate": |
169 | 169 | return null; |
170 | 170 | default: |
171 | - throw new \InvalidArgumentException('Invalid value encountered!: ' . $value); |
|
171 | + throw new \InvalidArgumentException('Invalid value encountered!: '.$value); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | \ No newline at end of file |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | foreach ($this->permission_structure['groups'] as $group) { |
65 | 65 | if (isset($group['label'])) { |
66 | 66 | $catalogue->add([ |
67 | - $group['label'] => '__' . $group['label'] |
|
67 | + $group['label'] => '__'.$group['label'] |
|
68 | 68 | ]); |
69 | 69 | } |
70 | 70 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | foreach ($this->permission_structure['perms'] as $perm) { |
74 | 74 | if (isset($perm['label'])) { |
75 | 75 | $catalogue->add([ |
76 | - $perm['label'] => '__' . $perm['label'] |
|
76 | + $perm['label'] => '__'.$perm['label'] |
|
77 | 77 | ]); |
78 | 78 | } |
79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | foreach ($perm['operations'] as $op) { |
82 | 82 | if (isset($op['label'])) { |
83 | 83 | $catalogue->add([ |
84 | - $op['label'] => '__' . $op['label'] |
|
84 | + $op['label'] => '__'.$op['label'] |
|
85 | 85 | ]); |
86 | 86 | } |
87 | 87 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | { |
60 | 60 | parent::configureOptions($resolver); |
61 | 61 | |
62 | - $resolver->setDefault('perm_name', function (Options $options) { |
|
62 | + $resolver->setDefault('perm_name', function(Options $options) { |
|
63 | 63 | return $options['name']; |
64 | 64 | }); |
65 | 65 | |
66 | - $resolver->setDefault('label', function (Options $options) { |
|
66 | + $resolver->setDefault('label', function(Options $options) { |
|
67 | 67 | if (!empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
68 | 68 | return $this->perm_structure['perms'][$options['perm_name']]['label']; |
69 | 69 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | return $options['name']; |
72 | 72 | }); |
73 | 73 | |
74 | - $resolver->setDefault('multi_checkbox', function (Options $options) { |
|
74 | + $resolver->setDefault('multi_checkbox', function(Options $options) { |
|
75 | 75 | return !$options['disabled']; |
76 | 76 | }); |
77 | 77 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | protected function voteOnUser($attribute, $subject, User $user): bool |
52 | 52 | { |
53 | 53 | if ($subject instanceof Group) { |
54 | - return $this->resolver->inherit($user,'groups', $attribute) ?? false; |
|
54 | + return $this->resolver->inherit($user, 'groups', $attribute) ?? false; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return false; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $resolver->setDefaults([ |
59 | 59 | 'show_legend' => true, |
60 | - 'constraints' => function (Options $options) { |
|
60 | + 'constraints' => function(Options $options) { |
|
61 | 61 | if (!$options['disabled']) { |
62 | 62 | return [new NoLockout()]; |
63 | 63 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $groups = $this->perm_structure['groups']; |
79 | 79 | |
80 | 80 | foreach ($groups as $key => $group) { |
81 | - $builder->add($key,PermissionGroupType::class, [ |
|
81 | + $builder->add($key, PermissionGroupType::class, [ |
|
82 | 82 | 'group_name' => $key, |
83 | 83 | 'mapped' => false, |
84 | 84 | 'data' => $builder->getData(), |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function getTests() |
87 | 87 | { |
88 | 88 | return [ |
89 | - new TwigTest('instanceof', function ($var, $instance) { |
|
89 | + new TwigTest('instanceof', function($var, $instance) { |
|
90 | 90 | return $var instanceof $instance; |
91 | 91 | } ) |
92 | 92 | ]; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function loginPath(string $path) : string |
114 | 114 | { |
115 | - $parts = explode("/" ,$path); |
|
115 | + $parts = explode("/", $path); |
|
116 | 116 | //Remove the part with |
117 | 117 | unset($parts[1]); |
118 | 118 | return implode("/", $parts); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | self::$utc ? self::$utc : self::$utc = new \DateTimeZone('UTC') |
66 | 66 | ); |
67 | 67 | |
68 | - if (! $converted) { |
|
68 | + if (!$converted) { |
|
69 | 69 | throw ConversionException::conversionFailedFormat( |
70 | 70 | $value, |
71 | 71 | $this->getName(), |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function getBitValue(string $permission_name, int $bit_n): int |
316 | 316 | { |
317 | - if(!$this->isValidPermissionName($permission_name)) { |
|
317 | + if (!$this->isValidPermissionName($permission_name)) { |
|
318 | 318 | throw new \InvalidArgumentException(sprintf('No permission with the name "%s" is existing!', $permission_name)); |
319 | 319 | } |
320 | 320 | |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | public function setPermissionValue(string $permission_name, int $bit_n, ?bool $new_value) : self |
359 | 359 | { |
360 | 360 | //Determine which bit value the given value is. |
361 | - if($new_value === true) { |
|
361 | + if ($new_value === true) { |
|
362 | 362 | $bit_value = static::ALLOW; |
363 | - } elseif($new_value === false) { |
|
363 | + } elseif ($new_value === false) { |
|
364 | 364 | $bit_value = static::DISALLOW; |
365 | 365 | } else { |
366 | 366 | $bit_value = static::INHERIT; |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | */ |
381 | 381 | public function setBitValue(string $permission_name, int $bit_n, int $new_value) : self |
382 | 382 | { |
383 | - if(!$this->isValidPermissionName($permission_name)) { |
|
383 | + if (!$this->isValidPermissionName($permission_name)) { |
|
384 | 384 | throw new \InvalidArgumentException('No permission with the given name is existing!'); |
385 | 385 | } |
386 | 386 |