@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | throw new \RuntimeException('$context must be a Part object!'); |
65 | 65 | } |
66 | 66 | $tmp = ""; |
67 | - $attachments = $context->getAttachments()->filter(function (Attachment $attachment) { |
|
67 | + $attachments = $context->getAttachments()->filter(function(Attachment $attachment) { |
|
68 | 68 | return $attachment->getShowInTable() && $this->attachmentManager->isFileExisting($attachment); |
69 | 69 | }); |
70 | 70 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $tmp .= sprintf( |
79 | 79 | '<a href="%s" title="%s" class="attach-table-icon" target="_blank" rel="noopener" data-no-ajax>%s</a>', |
80 | 80 | $this->urlGenerator->viewURL($attachment), |
81 | - htmlspecialchars($attachment->getName()) . ': ' . htmlspecialchars($attachment->getFilename()), |
|
81 | + htmlspecialchars($attachment->getName()).': '.htmlspecialchars($attachment->getFilename()), |
|
82 | 82 | $this->FAIconGenerator->generateIconHTML( |
83 | 83 | // Sometimes the extension can not be determined, so ensure a generic icon is shown |
84 | 84 | $this->FAIconGenerator->fileExtensionToFAType($attachment->getExtension() ?? 'file'), |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $dataTable->add('picture', TextColumn::class, [ |
70 | 70 | 'label' => '', |
71 | - 'render' => function ($value, Attachment $context) { |
|
71 | + 'render' => function($value, Attachment $context) { |
|
72 | 72 | if ($context->isPicture() |
73 | 73 | && !$context->isExternal() |
74 | 74 | && $this->attachmentHelper->isFileExisting($context)) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $dataTable->add('name', TextColumn::class, [ |
89 | 89 | 'label' => $this->translator->trans('attachment.edit.name'), |
90 | - 'render' => function ($value, Attachment $context) { |
|
90 | + 'render' => function($value, Attachment $context) { |
|
91 | 91 | //Link to external source |
92 | 92 | if ($context->isExternal()) { |
93 | 93 | return sprintf( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $dataTable->add('attachment_type', TextColumn::class, [ |
113 | 113 | 'label' => $this->translator->trans('attachment.table.type'), |
114 | 114 | 'field' => 'attachment_type.name', |
115 | - 'render' => function ($value, Attachment $context) { |
|
115 | + 'render' => function($value, Attachment $context) { |
|
116 | 116 | return sprintf( |
117 | 117 | '<a href="%s">%s</a>', |
118 | 118 | $this->entityURLGenerator->editURL($context->getAttachmentType()), |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $dataTable->add('element', TextColumn::class, [ |
125 | 125 | 'label' => $this->translator->trans('attachment.table.element'), |
126 | 126 | //'propertyPath' => 'element.name', |
127 | - 'render' => function ($value, Attachment $context) { |
|
127 | + 'render' => function($value, Attachment $context) { |
|
128 | 128 | return sprintf( |
129 | 129 | '<a href="%s">%s</a>', |
130 | 130 | $this->entityURLGenerator->infoURL($context->getElement()), |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ]); |
139 | 139 | |
140 | 140 | $dataTable->add('filesize', TextColumn::class, [ |
141 | - 'render' => function ($value, Attachment $context) { |
|
141 | + 'render' => function($value, Attachment $context) { |
|
142 | 142 | if ($this->attachmentHelper->isFileExisting($context)) { |
143 | 143 | return $this->attachmentHelper->getHumanFileSize($context); |
144 | 144 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $dataTable->createAdapter(ORMAdapter::class, [ |
204 | 204 | 'entity' => Attachment::class, |
205 | - 'query' => function (QueryBuilder $builder) { |
|
205 | + 'query' => function(QueryBuilder $builder) { |
|
206 | 206 | $this->getQuery($builder); |
207 | 207 | }, |
208 | 208 | ]); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | public function __construct(string $email, string $name) |
36 | 36 | { |
37 | - $this->email = $email; |
|
37 | + $this->email = $email; |
|
38 | 38 | $this->name = $name; |
39 | 39 | } |
40 | 40 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | if ('validMailDSN' === $prefix) { |
37 | 37 | try { |
38 | 38 | $env = $getEnv($name); |
39 | - return !empty($env) && $env !== 'null://null'; |
|
39 | + return !empty($env) && $env !== 'null://null'; |
|
40 | 40 | } catch (EnvNotFoundException $exception) { |
41 | 41 | return false; |
42 | 42 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | 'required' => false, |
96 | 96 | 'attr' => ['class' => 'selectpicker'], |
97 | 97 | 'choices' => User::AVAILABLE_THEMES, |
98 | - 'choice_label' => function ($entity, $key, $value) { |
|
98 | + 'choice_label' => function($entity, $key, $value) { |
|
99 | 99 | return $value; |
100 | 100 | }, |
101 | 101 | 'placeholder' => 'user_settings.theme.placeholder', |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | protected $security; |
44 | 44 | |
45 | - public function __construct( Security $security) |
|
45 | + public function __construct(Security $security) |
|
46 | 46 | { |
47 | 47 | $this->security = $security; |
48 | 48 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ]); |
78 | 78 | |
79 | 79 | //Add pricedetails after we know the data, so we can set the default currency |
80 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { |
|
80 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options) { |
|
81 | 81 | /** @var Orderdetail $orderdetail */ |
82 | 82 | $orderdetail = $event->getData(); |
83 | 83 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | { |
55 | 55 | $user = new User(); |
56 | 56 | $user->setGoogleAuthenticatorSecret($secret); |
57 | - $this->assertSame($expected ,$user->isGoogleAuthenticatorEnabled()); |
|
57 | + $this->assertSame($expected, $user->isGoogleAuthenticatorEnabled()); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | //Handle 2FA disabling |
71 | 71 | |
72 | - if($request->request->has('reset_2fa')) { |
|
72 | + if ($request->request->has('reset_2fa')) { |
|
73 | 73 | //Check if the admin has the needed permissions |
74 | 74 | $this->denyAccessUnlessGranted('set_password', $entity); |
75 | 75 | if ($this->isCsrfTokenValid('reset_2fa'.$entity->getId(), $request->request->get('_token'))) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $entity->setGoogleAuthenticatorSecret(null); |
78 | 78 | $entity->setBackupCodes([]); |
79 | 79 | //Remove all U2F keys |
80 | - foreach($entity->getU2FKeys() as $key) { |
|
80 | + foreach ($entity->getU2FKeys() as $key) { |
|
81 | 81 | $em->remove($key); |
82 | 82 | } |
83 | 83 | //Invalidate trusted devices |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function removeU2FToken(Request $request, EntityManagerInterface $entityManager, BackupCodeManager $backupCodeManager) |
87 | 87 | { |
88 | - if($this->demo_mode) { |
|
88 | + if ($this->demo_mode) { |
|
89 | 89 | throw new \RuntimeException('You can not do 2FA things in demo mode'); |
90 | 90 | } |
91 | 91 | |
@@ -100,13 +100,13 @@ discard block |
||
100 | 100 | |
101 | 101 | |
102 | 102 | if ($this->isCsrfTokenValid('delete'.$user->getId(), $request->request->get('_token'))) { |
103 | - if($request->request->has('key_id')) { |
|
103 | + if ($request->request->has('key_id')) { |
|
104 | 104 | $key_id = $request->request->get('key_id'); |
105 | 105 | $key_repo = $entityManager->getRepository(U2FKey::class); |
106 | 106 | /** @var U2FKey|null $u2f */ |
107 | 107 | $u2f = $key_repo->find($key_id); |
108 | - if($u2f === null) { |
|
109 | - $this->addFlash('danger','tfa_u2f.u2f_delete.not_existing'); |
|
108 | + if ($u2f === null) { |
|
109 | + $this->addFlash('danger', 'tfa_u2f.u2f_delete.not_existing'); |
|
110 | 110 | throw new \RuntimeException('Key not existing!'); |
111 | 111 | } |
112 | 112 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->addFlash('success', 'tfa.u2f.u2f_delete.success'); |
123 | 123 | } |
124 | 124 | } else { |
125 | - $this->addFlash('error','csfr_invalid'); |
|
125 | + $this->addFlash('error', 'csfr_invalid'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $this->redirectToRoute('user_settings'); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function resetTrustedDevices(Request $request, EntityManagerInterface $entityManager) |
135 | 135 | { |
136 | - if($this->demo_mode) { |
|
136 | + if ($this->demo_mode) { |
|
137 | 137 | throw new \RuntimeException('You can not do 2FA things in demo mode'); |
138 | 138 | } |
139 | 139 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $entityManager->flush(); |
153 | 153 | $this->addFlash('success', 'tfa_trustedDevice.invalidate.success'); |
154 | 154 | } else { |
155 | - $this->addFlash('error','csfr_invalid'); |
|
155 | + $this->addFlash('error', 'csfr_invalid'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | return $this->redirectToRoute('user_settings'); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } |
254 | 254 | $google_form->handleRequest($request); |
255 | 255 | |
256 | - if($google_form->isSubmitted() && $google_form->isValid() && !$this->demo_mode) { |
|
256 | + if ($google_form->isSubmitted() && $google_form->isValid() && !$this->demo_mode) { |
|
257 | 257 | if (!$google_enabled) { |
258 | 258 | //Save 2FA settings (save secrets) |
259 | 259 | $user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData()); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
274 | - $backup_form = $this->get('form.factory')->createNamedBuilder('backup_codes')->add('reset_codes', SubmitType::class,[ |
|
274 | + $backup_form = $this->get('form.factory')->createNamedBuilder('backup_codes')->add('reset_codes', SubmitType::class, [ |
|
275 | 275 | 'label' => 'tfa_backup.regenerate_codes', |
276 | 276 | 'attr' => ['class' => 'btn-danger'], |
277 | 277 | 'disabled' => empty($user->getBackupCodes()) |