@@ -48,8 +48,8 @@ |
||
48 | 48 | { |
49 | 49 | $resolver->setDefaults([ |
50 | 50 | 'show_legend' => true, |
51 | - 'constraints' => function (Options $options) { |
|
52 | - if (! $options['disabled']) { |
|
51 | + 'constraints' => function(Options $options) { |
|
52 | + if (!$options['disabled']) { |
|
53 | 53 | return [new NoLockout()]; |
54 | 54 | } |
55 | 55 |
@@ -48,20 +48,20 @@ |
||
48 | 48 | { |
49 | 49 | parent::configureOptions($resolver); |
50 | 50 | |
51 | - $resolver->setDefault('perm_name', function (Options $options) { |
|
51 | + $resolver->setDefault('perm_name', function(Options $options) { |
|
52 | 52 | return $options['name']; |
53 | 53 | }); |
54 | 54 | |
55 | - $resolver->setDefault('label', function (Options $options) { |
|
56 | - if (! empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
|
55 | + $resolver->setDefault('label', function(Options $options) { |
|
56 | + if (!empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
|
57 | 57 | return $this->perm_structure['perms'][$options['perm_name']]['label']; |
58 | 58 | } |
59 | 59 | |
60 | 60 | return $options['name']; |
61 | 61 | }); |
62 | 62 | |
63 | - $resolver->setDefault('multi_checkbox', function (Options $options) { |
|
64 | - return ! $options['disabled']; |
|
63 | + $resolver->setDefault('multi_checkbox', function(Options $options) { |
|
64 | + return !$options['disabled']; |
|
65 | 65 | }); |
66 | 66 | |
67 | 67 | $resolver->setDefaults([ |
@@ -73,14 +73,14 @@ |
||
73 | 73 | { |
74 | 74 | parent::configureOptions($resolver); |
75 | 75 | |
76 | - $resolver->setDefault('group_name', function (Options $options) { |
|
76 | + $resolver->setDefault('group_name', function(Options $options) { |
|
77 | 77 | return trim($options['name']); |
78 | 78 | }); |
79 | 79 | |
80 | 80 | $resolver->setDefault('inherit', false); |
81 | 81 | |
82 | - $resolver->setDefault('label', function (Options $options) { |
|
83 | - if (! empty($this->perm_structure['groups'][$options['group_name']]['label'])) { |
|
82 | + $resolver->setDefault('label', function(Options $options) { |
|
83 | + if (!empty($this->perm_structure['groups'][$options['group_name']]['label'])) { |
|
84 | 84 | return $this->perm_structure['groups'][$options['group_name']]['label']; |
85 | 85 | } |
86 | 86 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $resolver->setDefaults([ |
52 | 52 | 'measurement_unit' => null, |
53 | - 'show_prefix' => function (Options $options) { |
|
53 | + 'show_prefix' => function(Options $options) { |
|
54 | 54 | if (null !== $options['measurement_unit']) { |
55 | 55 | /** @var MeasurementUnit $unit */ |
56 | 56 | $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 (null !== $options['measurement_unit']) { |
65 | 65 | /** @var MeasurementUnit $unit */ |
66 | 66 | $unit = $options['measurement_unit']; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | return false; |
72 | 72 | }, |
73 | - 'unit' => function (Options $options) { |
|
73 | + 'unit' => function(Options $options) { |
|
74 | 74 | if (null !== $options['measurement_unit']) { |
75 | 75 | /** @var MeasurementUnit $unit */ |
76 | 76 | $unit = $options['measurement_unit']; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $resolver->setDefaults([ |
91 | 91 | 'min' => 0, |
92 | 92 | 'max' => '', |
93 | - 'step' => function (Options $options) { |
|
93 | + 'step' => function(Options $options) { |
|
94 | 94 | if (true === $options['is_integer']) { |
95 | 95 | return 1; |
96 | 96 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | //Disable import if user is not allowed to create elements. |
52 | 52 | $entity = new $data['entity_class'](); |
53 | 53 | $perm_name = 'create'; |
54 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
54 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
55 | 55 | |
56 | 56 | $builder |
57 | 57 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | { |
35 | 35 | $builder->add('footprint_3d', MasterPictureAttachmentType::class, [ |
36 | 36 | 'required' => false, |
37 | - 'disabled' => ! $this->security->isGranted(null === $entity->getID() ? 'create' : 'edit', $entity), |
|
37 | + 'disabled' => !$this->security->isGranted(null === $entity->getID() ? 'create' : 'edit', $entity), |
|
38 | 38 | 'label' => 'footprint.edit.3d_model', |
39 | 39 | 'filter' => '3d_model', |
40 | 40 | 'entity' => $entity, |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function validate($value, Constraint $constraint): void |
51 | 51 | { |
52 | - if (! $constraint instanceof ValidPermission) { |
|
52 | + if (!$constraint instanceof ValidPermission) { |
|
53 | 53 | throw new UnexpectedTypeException($constraint, ValidPermission::class); |
54 | 54 | } |
55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | //Check for each permission and operation, for an alsoSet attribute |
60 | 60 | foreach ($this->perm_structure['perms'] as $perm_key => $permission) { |
61 | 61 | foreach ($permission['operations'] as $op_key => $op) { |
62 | - if (! empty($op['alsoSet']) && |
|
62 | + if (!empty($op['alsoSet']) && |
|
63 | 63 | true === $this->resolver->dontInherit($perm_holder, $perm_key, $op_key)) { |
64 | 64 | //Set every op listed in also Set |
65 | 65 | foreach ($op['alsoSet'] as $set_also) { |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | { |
39 | 39 | public function validate($value, Constraint $constraint): void |
40 | 40 | { |
41 | - if (! $constraint instanceof UrlOrBuiltin) { |
|
41 | + if (!$constraint instanceof UrlOrBuiltin) { |
|
42 | 42 | throw new UnexpectedTypeException($constraint, UrlOrBuiltin::class); |
43 | 43 | } |
44 | 44 | |
45 | 45 | if (null === $value || '' === $value) { |
46 | 46 | return; |
47 | 47 | } |
48 | - if (! is_scalar($value) && ! (\is_object($value) && method_exists($value, '__toString'))) { |
|
48 | + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { |
|
49 | 49 | throw new UnexpectedValueException($value, 'string'); |
50 | 50 | } |
51 | 51 | $value = (string) $value; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | //After the %PLACEHOLDER% comes a slash, so we can check if we have a placholder via explode |
57 | 57 | $tmp = explode('/', $value); |
58 | 58 | //Builtins must have a %PLACEHOLDER% construction |
59 | - if (! empty($tmp) && \in_array($tmp[0], $constraint->allowed_placeholders, false)) { |
|
59 | + if (!empty($tmp) && \in_array($tmp[0], $constraint->allowed_placeholders, false)) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function validate($value, Constraint $constraint): void |
45 | 45 | { |
46 | - if (! $constraint instanceof ValidGoogleAuthCode) { |
|
46 | + if (!$constraint instanceof ValidGoogleAuthCode) { |
|
47 | 47 | throw new UnexpectedTypeException($constraint, ValidGoogleAuthCode::class); |
48 | 48 | } |
49 | 49 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | - if (! \is_string($value)) { |
|
54 | + if (!\is_string($value)) { |
|
55 | 55 | throw new UnexpectedValueException($value, 'string'); |
56 | 56 | } |
57 | 57 | |
58 | - if (! ctype_digit($value)) { |
|
58 | + if (!ctype_digit($value)) { |
|
59 | 59 | $this->context->addViolation('validator.google_code.only_digits_allowed'); |
60 | 60 | } |
61 | 61 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $user = $this->context->getObject()->getParent()->getData(); |
72 | 72 | |
73 | 73 | //Check if the given code is valid |
74 | - if (! $this->googleAuthenticator->checkCode($user, $value)) { |
|
74 | + if (!$this->googleAuthenticator->checkCode($user, $value)) { |
|
75 | 75 | $this->context->addViolation('validator.google_code.wrong_code'); |
76 | 76 | } |
77 | 77 | } |