@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if ( |
177 | 177 | $entity instanceof LabelProfile |
178 | 178 | && 'twig' === $entity->getOptions()->getLinesMode() |
179 | - && ! $this->isGranted('@labels.use_twig') |
|
179 | + && !$this->isGranted('@labels.use_twig') |
|
180 | 180 | ) { |
181 | 181 | $form_options['disable_options'] = true; |
182 | 182 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $form->handleRequest($request); |
187 | 187 | if ($form->isSubmitted() && $form->isValid()) { |
188 | 188 | //Check if we editing a user and if we need to change the password of it |
189 | - if ($entity instanceof User && ! empty($form['new_password']->getData())) { |
|
189 | + if ($entity instanceof User && !empty($form['new_password']->getData())) { |
|
190 | 190 | $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData()); |
191 | 191 | $entity->setPassword($password); |
192 | 192 | //By default the user must change the password afterwards |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | 'attachment_class' => $this->attachment_class, |
228 | 228 | 'parameter_class' => $this->parameter_class, |
229 | 229 | ]); |
230 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
230 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
231 | 231 | $this->addFlash('error', 'entity.edit_flash.invalid'); |
232 | 232 | } |
233 | 233 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $form->handleRequest($request); |
270 | 270 | |
271 | 271 | if ($form->isSubmitted() && $form->isValid()) { |
272 | - if ($new_entity instanceof User && ! empty($form['new_password']->getData())) { |
|
272 | + if ($new_entity instanceof User && !empty($form['new_password']->getData())) { |
|
273 | 273 | $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData()); |
274 | 274 | $new_entity->setPassword($password); |
275 | 275 | //By default the user must change the password afterwards |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); |
305 | 305 | } |
306 | 306 | |
307 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
307 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
308 | 308 | $this->addFlash('error', 'entity.created_flash.invalid'); |
309 | 309 | } |
310 | 310 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | //We have to disable the options, if twig mode is selected and user is not allowed to use it. |
84 | - $disable_options = 'twig' === $label_options->getLinesMode() && ! $this->isGranted('@labels.use_twig'); |
|
84 | + $disable_options = 'twig' === $label_options->getLinesMode() && !$this->isGranted('@labels.use_twig'); |
|
85 | 85 | |
86 | 86 | $form = $this->createForm(LabelDialogType::class, null, [ |
87 | 87 | 'disable_options' => $disable_options, |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | $filename = 'invalid.pdf'; |
110 | 110 | |
111 | 111 | //Generate PDF either when the form is submitted and valid, or the form was not submit yet, and generate is set |
112 | - if (($form->isSubmitted() && $form->isValid()) || ($generate && ! $form->isSubmitted() && null !== $profile)) { |
|
112 | + if (($form->isSubmitted() && $form->isValid()) || ($generate && !$form->isSubmitted() && null !== $profile)) { |
|
113 | 113 | $target_id = (string) $form->get('target_id')->getData(); |
114 | 114 | $targets = $this->findObjects($form_options->getSupportedElement(), $target_id); |
115 | - if (! empty($targets)) { |
|
115 | + if (!empty($targets)) { |
|
116 | 116 | try { |
117 | 117 | $pdf_data = $this->labelGenerator->generateLabel($form_options, $targets); |
118 | 118 | $filename = $this->getLabelName($targets[0], $profile); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | protected function findObjects(string $type, string $ids): array |
147 | 147 | { |
148 | - if (! isset(LabelGenerator::CLASS_SUPPORT_MAPPING[$type])) { |
|
148 | + if (!isset(LabelGenerator::CLASS_SUPPORT_MAPPING[$type])) { |
|
149 | 149 | throw new \InvalidArgumentException('The given type is not known and can not be mapped to a class!'); |
150 | 150 | } |
151 | 151 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $prefix = $matches[1]; |
56 | 56 | $id = (int) $matches[2]; |
57 | 57 | |
58 | - if (! isset(self::PREFIX_TYPE_MAP[$prefix])) { |
|
58 | + if (!isset(self::PREFIX_TYPE_MAP[$prefix])) { |
|
59 | 59 | throw new \InvalidArgumentException('Unknown prefix '.$prefix); |
60 | 60 | } |
61 | 61 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $prefix = $matches[1]; |
68 | 68 | $id = (int) $matches[2]; |
69 | 69 | |
70 | - if (! isset(self::PREFIX_TYPE_MAP[$prefix])) { |
|
70 | + if (!isset(self::PREFIX_TYPE_MAP[$prefix])) { |
|
71 | 71 | throw new \InvalidArgumentException('Unknown prefix '.$prefix); |
72 | 72 | } |
73 | 73 |
@@ -102,7 +102,7 @@ |
||
102 | 102 | |
103 | 103 | private function getStructuralData(string $class): AbstractStructuralDBElement |
104 | 104 | { |
105 | - if (! is_a($class, AbstractStructuralDBElement::class, true)) { |
|
105 | + if (!is_a($class, AbstractStructuralDBElement::class, true)) { |
|
106 | 106 | throw new \InvalidArgumentException('$class must be an child of AbstractStructuralDBElement'); |
107 | 107 | } |
108 | 108 |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function generateLabel(LabelOptions $options, $elements): string |
55 | 55 | { |
56 | - if (! is_array($elements) && ! is_object($elements)) { |
|
56 | + if (!is_array($elements) && !is_object($elements)) { |
|
57 | 57 | throw new \InvalidArgumentException('$element must be an object or an array of objects!'); |
58 | 58 | } |
59 | 59 | |
60 | - if (! is_array($elements)) { |
|
60 | + if (!is_array($elements)) { |
|
61 | 61 | $elements = [$elements]; |
62 | 62 | } |
63 | 63 | |
64 | 64 | foreach ($elements as $element) { |
65 | - if (! $this->supports($options, $element)) { |
|
65 | + if (!$this->supports($options, $element)) { |
|
66 | 66 | throw new \InvalidArgumentException('The given options are not compatible with the given element!'); |
67 | 67 | } |
68 | 68 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | public function supports(LabelOptions $options, object $element) |
84 | 84 | { |
85 | 85 | $supported_type = $options->getSupportedElement(); |
86 | - if (! isset(static::CLASS_SUPPORT_MAPPING[$supported_type])) { |
|
86 | + if (!isset(static::CLASS_SUPPORT_MAPPING[$supported_type])) { |
|
87 | 87 | throw new \InvalidArgumentException('Supported type name of the Label options not known!'); |
88 | 88 | } |
89 | 89 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | public function replace(string $placeholder, object $part, array $options = []): ?string |
42 | 42 | { |
43 | - if (! $part instanceof Part) { |
|
43 | + if (!$part instanceof Part) { |
|
44 | 44 | return null; |
45 | 45 | } |
46 | 46 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | /** @var LabelProfileRepository $repo */ |
52 | 52 | $repo = $this->entityManager->getRepository(LabelProfile::class); |
53 | 53 | |
54 | - return $this->cache->get($key, function (ItemInterface $item) use ($repo, $type, $secure_class_name) { |
|
54 | + return $this->cache->get($key, function(ItemInterface $item) use ($repo, $type, $secure_class_name) { |
|
55 | 55 | // Invalidate when groups, a element with the class or the user changes |
56 | 56 | $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]); |
57 | 57 |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $item->setSelected(true); |
115 | 115 | } |
116 | 116 | |
117 | - if (! empty($item->getNodes())) { |
|
117 | + if (!empty($item->getNodes())) { |
|
118 | 118 | $item->addTag((string) \count($item->getNodes())); |
119 | 119 | } |
120 | 120 | |
121 | - if (! empty($href_type) && null !== $item->getId()) { |
|
121 | + if (!empty($href_type) && null !== $item->getId()) { |
|
122 | 122 | $entity = $this->em->getPartialReference($class, $item->getId()); |
123 | 123 | $item->setHref($this->urlGenerator->getURL($entity, $href_type)); |
124 | 124 | } |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function getGenericTree(string $class, ?AbstractStructuralDBElement $parent = null): array |
146 | 146 | { |
147 | - if (! is_a($class, AbstractNamedDBElement::class, true)) { |
|
147 | + if (!is_a($class, AbstractNamedDBElement::class, true)) { |
|
148 | 148 | throw new \InvalidArgumentException('$class must be a class string that implements StructuralDBElement or NamedDBElement!'); |
149 | 149 | } |
150 | - if (null !== $parent && ! is_a($parent, $class)) { |
|
150 | + if (null !== $parent && !is_a($parent, $class)) { |
|
151 | 151 | throw new \InvalidArgumentException('$parent must be of the type $class!'); |
152 | 152 | } |
153 | 153 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $secure_class_name = str_replace('\\', '_', $class); |
163 | 163 | $key = 'treeview_'.$this->keyGenerator->generateKey().'_'.$secure_class_name; |
164 | 164 | |
165 | - return $this->cache->get($key, function (ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
165 | + return $this->cache->get($key, function(ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
166 | 166 | // Invalidate when groups, a element with the class or the user changes |
167 | 167 | $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]); |
168 | 168 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function validate($value, Constraint $constraint): void |
42 | 42 | { |
43 | - if (! $constraint instanceof ValidRange) { |
|
43 | + if (!$constraint instanceof ValidRange) { |
|
44 | 44 | throw new UnexpectedTypeException($constraint, ValidRange::class); |
45 | 45 | } |
46 | 46 | |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - if (! is_string($value)) { |
|
53 | + if (!is_string($value)) { |
|
54 | 54 | throw new UnexpectedValueException($value, 'string'); |
55 | 55 | } |
56 | 56 | |
57 | - if (! $this->rangeParser->isValidRange($value)) { |
|
57 | + if (!$this->rangeParser->isValidRange($value)) { |
|
58 | 58 | $this->context->buildViolation($constraint->message) |
59 | 59 | ->addViolation(); |
60 | 60 | } |