@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function validate($value, Constraint $constraint): void |
45 | 45 | { |
46 | - if (! $constraint instanceof Selectable) { |
|
46 | + if (!$constraint instanceof Selectable) { |
|
47 | 47 | throw new UnexpectedTypeException($constraint, Selectable::class); |
48 | 48 | } |
49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | //Check type of value. Validating only works for StructuralDBElements |
57 | - if (! $value instanceof StructuralDBElement) { |
|
57 | + if (!$value instanceof StructuralDBElement) { |
|
58 | 58 | throw new UnexpectedValueException($value, 'StructuralDBElement'); |
59 | 59 | } |
60 | 60 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | public function onRegister(RegisterEvent $event): void |
61 | 61 | { |
62 | 62 | //Skip adding of U2F key on demo mode |
63 | - if (! $this->demo_mode) { |
|
63 | + if (!$this->demo_mode) { |
|
64 | 64 | $user = $event->getUser(); |
65 | 65 | $registration = $event->getRegistration(); |
66 | 66 | $newKey = new U2FKey(); |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | public function onKernelResponse(FilterResponseEvent $event): void |
64 | 64 | { |
65 | - if (! $this->kernel->getParameter('kernel.debug')) { |
|
65 | + if (!$this->kernel->getParameter('kernel.debug')) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 |
@@ -50,12 +50,12 @@ |
||
50 | 50 | |
51 | 51 | //Check if the user has set a timezone |
52 | 52 | $user = $this->security->getUser(); |
53 | - if ($user instanceof User && ! empty($user->getTimezone())) { |
|
53 | + if ($user instanceof User && !empty($user->getTimezone())) { |
|
54 | 54 | $timezone = $user->getTimezone(); |
55 | 55 | } |
56 | 56 | |
57 | 57 | //Fill with default value if needed |
58 | - if (null === $timezone && ! empty($this->default_timezone)) { |
|
58 | + if (null === $timezone && !empty($this->default_timezone)) { |
|
59 | 59 | $timezone = $this->default_timezone; |
60 | 60 | } |
61 | 61 |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | $user = $this->security->getUser(); |
75 | 75 | $request = $event->getRequest(); |
76 | 76 | |
77 | - if (! $event->isMasterRequest()) { |
|
77 | + if (!$event->isMasterRequest()) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | - if (! $user instanceof User) { |
|
80 | + if (!$user instanceof User) { |
|
81 | 81 | return; |
82 | 82 | } |
83 | 83 | |
84 | 84 | //Abort if we dont need to redirect the user. |
85 | - if (! $user->isNeedPwChange() && ! static::TFARedirectNeeded($user)) { |
|
85 | + if (!$user->isNeedPwChange() && !static::TFARedirectNeeded($user)) { |
|
86 | 86 | return; |
87 | 87 | } |
88 | 88 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $tfa_enabled = $user->isU2FAuthEnabled() || $user->isGoogleAuthenticatorEnabled(); |
127 | 127 | |
128 | - if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && ! $tfa_enabled) { |
|
128 | + if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && !$tfa_enabled) { |
|
129 | 129 | return true; |
130 | 130 | } |
131 | 131 |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | { |
62 | 62 | $dataTable->add('picture', TextColumn::class, [ |
63 | 63 | 'label' => '', |
64 | - 'render' => function ($value, Attachment $context) { |
|
64 | + 'render' => function($value, Attachment $context) { |
|
65 | 65 | if ($context->isPicture() |
66 | - && ! $context->isExternal() |
|
66 | + && !$context->isExternal() |
|
67 | 67 | && $this->attachmentHelper->isFileExisting($context)) { |
68 | 68 | return sprintf( |
69 | 69 | '<img alt="%s" src="%s" data-thumbnail="%s" class="%s">', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $dataTable->add('name', TextColumn::class, [ |
82 | 82 | 'label' => 'attachment.edit.name', |
83 | - 'render' => function ($value, Attachment $context) { |
|
83 | + 'render' => function($value, Attachment $context) { |
|
84 | 84 | //Link to external source |
85 | 85 | if ($context->isExternal()) { |
86 | 86 | return sprintf( |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $dataTable->add('attachment_type', TextColumn::class, [ |
106 | 106 | 'label' => 'attachment.table.type', |
107 | 107 | 'field' => 'attachment_type.name', |
108 | - 'render' => function ($value, Attachment $context) { |
|
108 | + 'render' => function($value, Attachment $context) { |
|
109 | 109 | return sprintf( |
110 | 110 | '<a href="%s">%s</a>', |
111 | 111 | $this->entityURLGenerator->editURL($context->getAttachmentType()), |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $dataTable->add('element', TextColumn::class, [ |
118 | 118 | 'label' => 'attachment.table.element', |
119 | 119 | //'propertyPath' => 'element.name', |
120 | - 'render' => function ($value, Attachment $context) { |
|
120 | + 'render' => function($value, Attachment $context) { |
|
121 | 121 | return sprintf( |
122 | 122 | '<a href="%s">%s</a>', |
123 | 123 | $this->entityURLGenerator->infoURL($context->getElement()), |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | $dataTable->add('filesize', TextColumn::class, [ |
135 | 135 | 'label' => $this->translator->trans('attachment.table.filesize'), |
136 | - 'render' => function ($value, Attachment $context) { |
|
136 | + 'render' => function($value, Attachment $context) { |
|
137 | 137 | if ($this->attachmentHelper->isFileExisting($context)) { |
138 | 138 | return $this->attachmentHelper->getHumanFileSize($context); |
139 | 139 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | $dataTable->createAdapter(ORMAdapter::class, [ |
199 | 199 | 'entity' => Attachment::class, |
200 | - 'query' => function (QueryBuilder $builder): void { |
|
200 | + 'query' => function(QueryBuilder $builder): void { |
|
201 | 201 | $this->getQuery($builder); |
202 | 202 | }, |
203 | 203 | ]); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $children = $element->getChildren(); |
59 | 59 | |
60 | 60 | //If we should call from top we execute the func here. |
61 | - if (! $call_from_bottom) { |
|
61 | + if (!$call_from_bottom) { |
|
62 | 62 | $func($element); |
63 | 63 | } |
64 | 64 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $em = $this->em; |
85 | 85 | |
86 | - $this->execute($element, static function (StructuralDBElement $element) use ($em): void { |
|
86 | + $this->execute($element, static function(StructuralDBElement $element) use ($em): void { |
|
87 | 87 | $em->remove($element); |
88 | 88 | }); |
89 | 89 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function extract($resource, MessageCatalogue $catalogue): void |
52 | 52 | { |
53 | - if (! $this->finished) { |
|
53 | + if (!$this->finished) { |
|
54 | 54 | //Extract for every group... |
55 | 55 | foreach ($this->permission_structure['groups'] as $group) { |
56 | 56 | if (isset($group['label'])) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function listOperationsForPermission(string $permission): array |
157 | 157 | { |
158 | - if (! $this->isValidPermission($permission)) { |
|
158 | + if (!$this->isValidPermission($permission)) { |
|
159 | 159 | throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission)); |
160 | 160 | } |
161 | 161 | $operations = $this->permission_structure['perms'][$permission]['operations']; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $cache = new ConfigCache($this->cache_file, $this->is_debug); |
195 | 195 | |
196 | 196 | //Check if the cache is fresh, else regenerate it. |
197 | - if (! $cache->isFresh()) { |
|
197 | + if (!$cache->isFresh()) { |
|
198 | 198 | $permission_file = __DIR__.'/../../config/permissions.yaml'; |
199 | 199 | |
200 | 200 | //Read the permission config file... |