@@ -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 |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | $format = $request->get('format') ?? 'json'; |
57 | 57 | |
58 | 58 | //Check if we have one of the supported formats |
59 | - if (! \in_array($format, ['json', 'csv', 'yaml', 'xml'], true)) { |
|
59 | + if (!\in_array($format, ['json', 'csv', 'yaml', 'xml'], true)) { |
|
60 | 60 | throw new \InvalidArgumentException('Given format is not supported!'); |
61 | 61 | } |
62 | 62 | |
63 | 63 | //Check export verbosity level |
64 | 64 | $level = $request->get('level') ?? 'extended'; |
65 | - if (! \in_array($level, ['simple', 'extended', 'full'], true)) { |
|
65 | + if (!\in_array($level, ['simple', 'extended', 'full'], true)) { |
|
66 | 66 | throw new \InvalidArgumentException('Given level is not supported!'); |
67 | 67 | } |
68 | 68 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $response->headers->set('Content-Type', $content_type); |
109 | 109 | |
110 | 110 | //If view option is not specified, then download the file. |
111 | - if (! $request->get('view')) { |
|
111 | + if (!$request->get('view')) { |
|
112 | 112 | if ($entity instanceof NamedDBElement) { |
113 | 113 | $entity_name = $entity->getName(); |
114 | 114 | } elseif (\is_array($entity)) { |