@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $id = (int) $matches[2]; |
55 | 55 | |
56 | 56 | if (!isset(self::PREFIX_TYPE_MAP[$prefix])) { |
57 | - throw new \InvalidArgumentException('Unknown prefix ' . $prefix); |
|
57 | + throw new \InvalidArgumentException('Unknown prefix '.$prefix); |
|
58 | 58 | } |
59 | 59 | return [self::PREFIX_TYPE_MAP[$prefix], $id]; |
60 | 60 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $id = (int) $matches[2]; |
66 | 66 | |
67 | 67 | if (!isset(self::PREFIX_TYPE_MAP[$prefix])) { |
68 | - throw new \InvalidArgumentException('Unknown prefix ' . $prefix); |
|
68 | + throw new \InvalidArgumentException('Unknown prefix '.$prefix); |
|
69 | 69 | } |
70 | 70 | return [self::PREFIX_TYPE_MAP[$prefix], $id]; |
71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $prefix = $this->classToString(self::PREFIX_MAP, $target); |
79 | 79 | $id = sprintf('%04d', $target->getID() ?? 0); |
80 | - return $prefix . $id; |
|
80 | + return $prefix.$id; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | private function classToString(array $map, object $target): string |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | return $map[$class]; |
88 | 88 | } |
89 | 89 | |
90 | - foreach($map as $class => $string) { |
|
90 | + foreach ($map as $class => $string) { |
|
91 | 91 | if (is_a($target, $class)) { |
92 | 92 | return $string; |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | - throw new \InvalidArgumentException('Unknown object class ' . get_class($target)); |
|
96 | + throw new \InvalidArgumentException('Unknown object class '.get_class($target)); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | \ No newline at end of file |
@@ -44,12 +44,12 @@ |
||
44 | 44 | public function getDropdownProfiles(string $type): array |
45 | 45 | { |
46 | 46 | $secure_class_name = str_replace('\\', '_', LabelProfile::class); |
47 | - $key = 'profile_dropdown_'.$this->keyGenerator->generateKey().'_'.$secure_class_name . '_' . $type; |
|
47 | + $key = 'profile_dropdown_'.$this->keyGenerator->generateKey().'_'.$secure_class_name.'_'.$type; |
|
48 | 48 | |
49 | 49 | /** @var LabelProfileRepository $repo */ |
50 | 50 | $repo = $this->entityManager->getRepository(LabelProfile::class); |
51 | 51 | |
52 | - return $this->cache->get($key, function (ItemInterface $item) use ($repo, $type, $secure_class_name) { |
|
52 | + return $this->cache->get($key, function(ItemInterface $item) use ($repo, $type, $secure_class_name) { |
|
53 | 53 | // Invalidate when groups, a element with the class or the user changes |
54 | 54 | $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]); |
55 | 55 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | if ($part->getManufacturingStatus() === '') { |
87 | 87 | return ''; |
88 | 88 | } |
89 | - return $this->translator->trans('m_status.' . $part->getManufacturingStatus()); |
|
89 | + return $this->translator->trans('m_status.'.$part->getManufacturingStatus()); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $parsedown = new \Parsedown(); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | public function replace(string $lines, object $target): string |
66 | 66 | { |
67 | 67 | $patterns = [ |
68 | - '/(\[\[[A-Z_]+\]\])/' => function ($match) use ($target) { |
|
68 | + '/(\[\[[A-Z_]+\]\])/' => function($match) use ($target) { |
|
69 | 69 | return $this->handlePlaceholder($match[0], $target); |
70 | 70 | }, |
71 | 71 | ]; |
@@ -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) && $item->getId() !== null) { |
|
121 | + if (!empty($href_type) && $item->getId() !== null) { |
|
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 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | } elseif (empty($number)) { //Allow empty tokens |
49 | 49 | continue; |
50 | 50 | } else { |
51 | - throw new \InvalidArgumentException('Invalid range encoutered: ' . $number); |
|
51 | + throw new \InvalidArgumentException('Invalid range encoutered: '.$number); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'attr' => [ |
96 | 96 | 'placeholder' => 'part.name.placeholder', |
97 | 97 | ], |
98 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
98 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
99 | 99 | ]); |
100 | 100 | |
101 | 101 | if ($entity instanceof AbstractStructuralDBElement) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | 'allow_delete' => true, |
150 | 150 | 'label' => false, |
151 | 151 | 'reindex_enable' => true, |
152 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
152 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
153 | 153 | 'entry_options' => [ |
154 | 154 | 'data_class' => $options['attachment_class'], |
155 | 155 | ], |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
160 | 160 | 'required' => false, |
161 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
161 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
162 | 162 | 'label' => 'part.edit.master_attachment', |
163 | 163 | 'entity' => $entity, |
164 | 164 | ]); |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | 'attr' => [ |
197 | 197 | 'class' => $is_new ? 'btn-success' : '', |
198 | 198 | ], |
199 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
199 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
200 | 200 | ]) |
201 | 201 | ->add('reset', ResetType::class, [ |
202 | 202 | 'label' => 'entity.edit.reset', |
203 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
203 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
204 | 204 | ]); |
205 | 205 | } |
206 | 206 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'attr' => [ |
96 | 96 | 'placeholder' => 'user.username.placeholder', |
97 | 97 | ], |
98 | - 'disabled' => ! $this->security->isGranted('edit_username', $entity), |
|
98 | + 'disabled' => !$this->security->isGranted('edit_username', $entity), |
|
99 | 99 | ]) |
100 | 100 | |
101 | 101 | ->add('group', StructuralEntityType::class, [ |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | 'required' => false, |
104 | 104 | 'label' => 'group.label', |
105 | 105 | 'disable_not_selectable' => true, |
106 | - 'disabled' => ! $this->security->isGranted('change_group', $entity), |
|
106 | + 'disabled' => !$this->security->isGranted('change_group', $entity), |
|
107 | 107 | ]) |
108 | 108 | |
109 | 109 | ->add('first_name', TextType::class, [ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | 'placeholder' => 'user.firstName.placeholder', |
114 | 114 | ], |
115 | 115 | 'required' => false, |
116 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
116 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
117 | 117 | ]) |
118 | 118 | |
119 | 119 | ->add('last_name', TextType::class, [ |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | 'placeholder' => 'user.lastName.placeholder', |
124 | 124 | ], |
125 | 125 | 'required' => false, |
126 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
126 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
127 | 127 | ]) |
128 | 128 | |
129 | 129 | ->add('email', TextType::class, [ |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'placeholder' => 'user.email.placeholder', |
134 | 134 | ], |
135 | 135 | 'required' => false, |
136 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
136 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
137 | 137 | ]) |
138 | 138 | |
139 | 139 | ->add('department', TextType::class, [ |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'placeholder' => 'user.department.placeholder', |
144 | 144 | ], |
145 | 145 | 'required' => false, |
146 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
146 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
147 | 147 | ]) |
148 | 148 | |
149 | 149 | //Config section |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'placeholder' => 'user_settings.language.placeholder', |
157 | 157 | 'label' => 'user.language_select', |
158 | 158 | 'preferred_choices' => ['en', 'de'], |
159 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
159 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
160 | 160 | ]) |
161 | 161 | ->add('timezone', TimezoneType::class, [ |
162 | 162 | 'required' => false, |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | 'placeholder' => 'user_settings.timezone.placeholder', |
168 | 168 | 'label' => 'user.timezone.label', |
169 | 169 | 'preferred_choices' => ['Europe/Berlin'], |
170 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
170 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
171 | 171 | ]) |
172 | 172 | ->add('theme', ChoiceType::class, [ |
173 | 173 | 'required' => false, |
174 | 174 | 'choices' => User::AVAILABLE_THEMES, |
175 | - 'choice_label' => function ($entity, $key, $value) { |
|
175 | + 'choice_label' => function($entity, $key, $value) { |
|
176 | 176 | return $value; |
177 | 177 | }, |
178 | 178 | 'attr' => [ |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | 'choice_translation_domain' => false, |
182 | 182 | 'placeholder' => 'user_settings.theme.placeholder', |
183 | 183 | 'label' => 'user.theme.label', |
184 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
184 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
185 | 185 | ]) |
186 | 186 | ->add('currency', CurrencyEntityType::class, [ |
187 | 187 | 'required' => false, |
188 | 188 | 'label' => 'user.currency.label', |
189 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
189 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
190 | 190 | ]) |
191 | 191 | |
192 | 192 | ->add('new_password', RepeatedType::class, [ |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'invalid_message' => 'password_must_match', |
201 | 201 | 'required' => false, |
202 | 202 | 'mapped' => false, |
203 | - 'disabled' => ! $this->security->isGranted('set_password', $entity), |
|
203 | + 'disabled' => !$this->security->isGranted('set_password', $entity), |
|
204 | 204 | 'constraints' => [new Length([ |
205 | 205 | 'min' => 6, |
206 | 206 | 'max' => 128, |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | 'class' => 'checkbox-custom', |
214 | 214 | ], |
215 | 215 | 'label' => 'user.edit.needs_pw_change', |
216 | - 'disabled' => ! $this->security->isGranted('set_password', $entity), |
|
216 | + 'disabled' => !$this->security->isGranted('set_password', $entity), |
|
217 | 217 | ]) |
218 | 218 | |
219 | 219 | ->add('disabled', CheckboxType::class, [ |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | 'class' => 'checkbox-custom', |
223 | 223 | ], |
224 | 224 | 'label' => 'user.edit.user_disabled', |
225 | - 'disabled' => ! $this->security->isGranted('set_password', $entity) |
|
225 | + 'disabled' => !$this->security->isGranted('set_password', $entity) |
|
226 | 226 | || $entity === $this->security->getUser(), |
227 | 227 | ]) |
228 | 228 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | ->add('permissions', PermissionsType::class, [ |
231 | 231 | 'mapped' => false, |
232 | 232 | 'data' => $builder->getData(), |
233 | - 'disabled' => ! $this->security->isGranted('edit_permissions', $entity), |
|
233 | + 'disabled' => !$this->security->isGranted('edit_permissions', $entity), |
|
234 | 234 | ]) |
235 | 235 | ; |
236 | 236 | /*->add('comment', CKEditorType::class, ['required' => false, |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | 'data_class' => $options['attachment_class'], |
251 | 251 | ], |
252 | 252 | 'by_reference' => false, |
253 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
253 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
254 | 254 | ]); |
255 | 255 | |
256 | 256 | $builder->add('log_comment', TextType::class, [ |