@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | */ |
345 | 345 | final public static function levelIntToString(int $level): string |
346 | 346 | { |
347 | - if (! isset(self::LEVEL_ID_TO_STRING[$level])) { |
|
347 | + if (!isset(self::LEVEL_ID_TO_STRING[$level])) { |
|
348 | 348 | throw new \InvalidArgumentException('No level with this int is existing!'); |
349 | 349 | } |
350 | 350 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | final public static function levelStringToInt(string $level): int |
362 | 362 | { |
363 | 363 | $tmp = array_flip(self::LEVEL_ID_TO_STRING); |
364 | - if (! isset($tmp[$level])) { |
|
364 | + if (!isset($tmp[$level])) { |
|
365 | 365 | throw new \InvalidArgumentException('No level with this string is existing!'); |
366 | 366 | } |
367 | 367 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | */ |
378 | 378 | final public static function targetTypeIdToClass(int $type_id): string |
379 | 379 | { |
380 | - if (! isset(self::TARGET_CLASS_MAPPING[$type_id])) { |
|
380 | + if (!isset(self::TARGET_CLASS_MAPPING[$type_id])) { |
|
381 | 381 | throw new \InvalidArgumentException('No target type with this ID is existing!'); |
382 | 382 | } |
383 | 383 |
@@ -103,12 +103,12 @@ |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | //Check if the event type is black listed |
106 | - if (! empty($blacklist) && $this->isObjectClassInArray($logEntry, $blacklist)) { |
|
106 | + if (!empty($blacklist) && $this->isObjectClassInArray($logEntry, $blacklist)) { |
|
107 | 107 | return false; |
108 | 108 | } |
109 | 109 | |
110 | 110 | //Check for whitelisting |
111 | - if (! empty($whitelist) && ! $this->isObjectClassInArray($logEntry, $whitelist)) { |
|
111 | + if (!empty($whitelist) && !$this->isObjectClassInArray($logEntry, $whitelist)) { |
|
112 | 112 | return false; |
113 | 113 | } |
114 | 114 |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | $qb->resetDQLPart('orderBy'); |
224 | 224 | $gb = $qb->getDQLPart('groupBy'); |
225 | - if (empty($gb) || ! $this->hasGroupByPart($identifier, $gb)) { |
|
225 | + if (empty($gb) || !$this->hasGroupByPart($identifier, $gb)) { |
|
226 | 226 | $qb->select($qb->expr()->count($identifier)); |
227 | 227 | |
228 | 228 | return (int) $qb->getQuery()->getSingleScalarResult(); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | protected function configureOptions(OptionsResolver $resolver): void |
283 | 283 | { |
284 | - $providerNormalizer = function (Options $options, $value) { |
|
284 | + $providerNormalizer = function(Options $options, $value) { |
|
285 | 285 | return array_map([$this, 'normalizeProcessor'], (array) $value); |
286 | 286 | }; |
287 | 287 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | ->setDefaults([ |
290 | 290 | 'hydrate' => Query::HYDRATE_OBJECT, |
291 | 291 | 'query' => [], |
292 | - 'criteria' => function (Options $options) { |
|
292 | + 'criteria' => function(Options $options) { |
|
293 | 293 | return [new SearchCriteriaProvider()]; |
294 | 294 | }, |
295 | 295 | ]) |
@@ -41,7 +41,7 @@ |
||
41 | 41 | /** @var AbstractStructuralDBElement $element */ |
42 | 42 | $element = $this->current(); |
43 | 43 | |
44 | - return ! empty($element->getSubelements()); |
|
44 | + return !empty($element->getSubelements()); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getChildren() |
@@ -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 AbstractStructuralDBElement) { |
|
57 | + if (!$value instanceof AbstractStructuralDBElement) { |
|
58 | 58 | throw new UnexpectedValueException($value, 'StructuralDBElement'); |
59 | 59 | } |
60 | 60 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function validate($value, Constraint $constraint): void |
45 | 45 | { |
46 | - if (! $constraint instanceof NoneOfItsChildren) { |
|
46 | + if (!$constraint instanceof NoneOfItsChildren) { |
|
47 | 47 | throw new UnexpectedTypeException($constraint, NoneOfItsChildren::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 AbstractStructuralDBElement) { |
|
57 | + if (!$value instanceof AbstractStructuralDBElement) { |
|
58 | 58 | throw new UnexpectedValueException($value, 'StructuralDBElement'); |
59 | 59 | } |
60 | 60 |
@@ -524,7 +524,7 @@ |
||
524 | 524 | public function setName(string $new_name): AbstractNamedDBElement |
525 | 525 | { |
526 | 526 | // Anonymous user is not allowed to change its username |
527 | - if (! $this->isAnonymousUser()) { |
|
527 | + if (!$this->isAnonymousUser()) { |
|
528 | 528 | $this->name = $new_name; |
529 | 529 | } |
530 | 530 |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | $format = $request->get('format') ?? 'json'; |
62 | 62 | |
63 | 63 | //Check if we have one of the supported formats |
64 | - if (! in_array($format, ['json', 'csv', 'yaml', 'xml'], true)) { |
|
64 | + if (!in_array($format, ['json', 'csv', 'yaml', 'xml'], true)) { |
|
65 | 65 | throw new InvalidArgumentException('Given format is not supported!'); |
66 | 66 | } |
67 | 67 | |
68 | 68 | //Check export verbosity level |
69 | 69 | $level = $request->get('level') ?? 'extended'; |
70 | - if (! in_array($level, ['simple', 'extended', 'full'], true)) { |
|
70 | + if (!in_array($level, ['simple', 'extended', 'full'], true)) { |
|
71 | 71 | throw new InvalidArgumentException('Given level is not supported!'); |
72 | 72 | } |
73 | 73 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $response->headers->set('Content-Type', $content_type); |
114 | 114 | |
115 | 115 | //If view option is not specified, then download the file. |
116 | - if (! $request->get('view')) { |
|
116 | + if (!$request->get('view')) { |
|
117 | 117 | if ($entity instanceof AbstractNamedDBElement) { |
118 | 118 | $entity_name = $entity->getName(); |
119 | 119 | } elseif (is_array($entity)) { |
@@ -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, ?AbstractStructuralDBElement $parent = null): array |
123 | 123 | { |
124 | - if (! is_a($class, AbstractNamedDBElement::class, true)) { |
|
124 | + if (!is_a($class, AbstractNamedDBElement::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 |