@@ -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... |
@@ -63,7 +63,7 @@ |
||
63 | 63 | $secure_class_name = str_replace('\\', '_', $class_name); |
64 | 64 | $key = 'list_'.$this->keyGenerator->generateKey().'_'.$secure_class_name.$parent_id; |
65 | 65 | |
66 | - return $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
66 | + return $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
67 | 67 | // Invalidate when groups, a element with the class or the user changes |
68 | 68 | $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]); |
69 | 69 | /** @var StructuralDBElementRepository */ |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | $item->setSelected(true); |
97 | 97 | } |
98 | 98 | |
99 | - if (! empty($item->getNodes())) { |
|
99 | + if (!empty($item->getNodes())) { |
|
100 | 100 | $item->addTag((string) \count($item->getNodes())); |
101 | 101 | } |
102 | 102 | |
103 | - if (! empty($href_type)) { |
|
103 | + if (!empty($href_type)) { |
|
104 | 104 | $entity = $this->em->getPartialReference($class, $item->getId()); |
105 | 105 | $item->setHref($this->urlGenerator->getURL($entity, $href_type)); |
106 | 106 | } |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getGenericTree(string $class, ?StructuralDBElement $parent = null): array |
123 | 123 | { |
124 | - if (! is_a($class, NamedDBElement::class, true)) { |
|
124 | + if (!is_a($class, NamedDBElement::class, true)) { |
|
125 | 125 | throw new \InvalidArgumentException('$class must be a class string that implements StructuralDBElement or NamedDBElement!'); |
126 | 126 | } |
127 | - if (null !== $parent && ! is_a($parent, $class)) { |
|
127 | + if (null !== $parent && !is_a($parent, $class)) { |
|
128 | 128 | throw new \InvalidArgumentException('$parent must be of the type $class!'); |
129 | 129 | } |
130 | 130 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $secure_class_name = str_replace('\\', '_', $class); |
140 | 140 | $key = 'treeview_'.$this->keyGenerator->generateKey().'_'.$secure_class_name; |
141 | 141 | |
142 | - return $this->cache->get($key, function (ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
142 | + return $this->cache->get($key, function(ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
143 | 143 | // Invalidate when groups, a element with the class or the user changes |
144 | 144 | $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]); |
145 | 145 |
@@ -293,7 +293,7 @@ |
||
293 | 293 | $class = \get_class($entity); |
294 | 294 | |
295 | 295 | //Check if we have an direct mapping for the given class |
296 | - if (! \array_key_exists($class, $map)) { |
|
296 | + if (!\array_key_exists($class, $map)) { |
|
297 | 297 | //Check if we need to check inheritance by looping through our map |
298 | 298 | foreach ($map as $key => $value) { |
299 | 299 | if (is_a($entity, $key)) { |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | //Expand every line to a single entry: |
61 | 61 | $names = explode("\n", $lines); |
62 | 62 | |
63 | - if (! is_a($class_name, StructuralDBElement::class, true)) { |
|
63 | + if (!is_a($class_name, StructuralDBElement::class, true)) { |
|
64 | 64 | throw new \InvalidArgumentException('$class_name must be a StructuralDBElement type!'); |
65 | 65 | } |
66 | - if (null !== $parent && ! is_a($parent, $class_name)) { |
|
66 | + if (null !== $parent && !is_a($parent, $class_name)) { |
|
67 | 67 | throw new \InvalidArgumentException('$parent must have the same type as specified in $class_name!'); |
68 | 68 | } |
69 | 69 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | ['groups' => $groups, 'csv_delimiter' => $options['csv_separator']]); |
175 | 175 | |
176 | 176 | //Ensure we have an array of entitity elements. |
177 | - if (! \is_array($entities)) { |
|
177 | + if (!\is_array($entities)) { |
|
178 | 178 | $entities = [$entities]; |
179 | 179 | } |
180 | 180 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $expiration_date->add(date_interval_create_from_date_string('1 day')); |
74 | 74 | $user->setPwResetExpires($expiration_date); |
75 | 75 | |
76 | - if (! empty($user->getEmail())) { |
|
76 | + if (!empty($user->getEmail())) { |
|
77 | 77 | $address = new Address($user->getEmail(), $user->getFullName()); |
78 | 78 | $mail = new TemplatedEmail(); |
79 | 79 | $mail->to($address); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | //Check if token is valid |
124 | - if (! $this->passwordEncoder->isPasswordValid($user->getPwResetToken(), $token, null)) { |
|
124 | + if (!$this->passwordEncoder->isPasswordValid($user->getPwResetToken(), $token, null)) { |
|
125 | 125 | return false; |
126 | 126 | } |
127 | 127 |