@@ -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 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | 'label_options.barcode_type.code93' => 'code93', |
84 | 84 | 'label_options.barcode_type.datamatrix' => 'datamatrix', |
85 | 85 | ], |
86 | - 'group_by' => function ($choice, $key, $value) { |
|
86 | + 'group_by' => function($choice, $key, $value) { |
|
87 | 87 | if (in_array($choice, ['qr', 'datamatrix'], true)) { |
88 | 88 | return 'label_options.barcode_type.2D'; |
89 | 89 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | 'label_attr' => [ |
133 | 133 | 'class' => 'radio-custom radio-inline', |
134 | 134 | ], |
135 | - 'disabled' => ! $this->security->isGranted('@labels.use_twig'), |
|
135 | + 'disabled' => !$this->security->isGranted('@labels.use_twig'), |
|
136 | 136 | ]); |
137 | 137 | } |
138 | 138 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | $builder->add('options', LabelOptionsType::class, [ |
56 | 56 | 'label' => false, |
57 | - 'disabled' => ! $this->security->isGranted('@labels.edit_options') || $options['disable_options'], |
|
57 | + 'disabled' => !$this->security->isGranted('@labels.edit_options') || $options['disable_options'], |
|
58 | 58 | ]); |
59 | 59 | $builder->add('update', SubmitType::class, [ |
60 | 60 | 'label' => 'label_generator.update', |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'attr' => [ |
95 | 95 | 'placeholder' => 'part.name.placeholder', |
96 | 96 | ], |
97 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
97 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
98 | 98 | ]); |
99 | 99 | |
100 | 100 | if ($entity instanceof AbstractStructuralDBElement) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'class' => get_class($entity), |
106 | 106 | 'required' => false, |
107 | 107 | 'label' => 'parent.label', |
108 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
108 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
109 | 109 | ] |
110 | 110 | ) |
111 | 111 | ->add( |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | 'label_attr' => [ |
119 | 119 | 'class' => 'checkbox-custom', |
120 | 120 | ], |
121 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
121 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
122 | 122 | ] |
123 | 123 | ); |
124 | 124 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'rows' => 4, |
135 | 135 | ], |
136 | 136 | 'help' => 'bbcode.hint', |
137 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
137 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
138 | 138 | ] |
139 | 139 | ); |
140 | 140 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | 'allow_delete' => true, |
149 | 149 | 'label' => false, |
150 | 150 | 'reindex_enable' => true, |
151 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
151 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
152 | 152 | 'entry_options' => [ |
153 | 153 | 'data_class' => $options['attachment_class'], |
154 | 154 | ], |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
159 | 159 | 'required' => false, |
160 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
160 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
161 | 161 | 'label' => 'part.edit.master_attachment', |
162 | 162 | 'entity' => $entity, |
163 | 163 | ]); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | 'entry_type' => ParameterType::class, |
178 | 178 | 'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
179 | 179 | 'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
180 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
180 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
181 | 181 | 'reindex_enable' => true, |
182 | 182 | 'label' => false, |
183 | 183 | 'by_reference' => false, |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | 'attr' => [ |
196 | 196 | 'class' => $is_new ? 'btn-success' : '', |
197 | 197 | ], |
198 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
198 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
199 | 199 | ]) |
200 | 200 | ->add('reset', ResetType::class, [ |
201 | 201 | 'label' => 'entity.edit.reset', |
202 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
202 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
203 | 203 | ]); |
204 | 204 | } |
205 | 205 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getDropdownProfiles(string $type): array |
39 | 39 | { |
40 | - if (! in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) { |
|
40 | + if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) { |
|
41 | 41 | throw new \InvalidArgumentException('Invalid supported_element type given.'); |
42 | 42 | } |
43 | 43 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $type_children[] = $node; |
65 | 65 | } |
66 | 66 | |
67 | - if (! empty($type_children)) { |
|
67 | + if (!empty($type_children)) { |
|
68 | 68 | //Use default label e.g. 'part_label'. $$ marks that it will be translated in TreeViewGenerator |
69 | 69 | $tmp = new TreeViewNode('$$'.$type.'.label', null, $type_children); |
70 | 70 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function findForSupportedElement(string $type, array $order_by = ['name' => 'ASC']): array |
87 | 87 | { |
88 | - if (! in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) { |
|
88 | + if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) { |
|
89 | 89 | throw new \InvalidArgumentException('Invalid supported_element type given.'); |
90 | 90 | } |
91 | 91 |