@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | { |
59 | 59 | $dataTable//->add("id", TextColumn::class) |
60 | 60 | ->add('name', TextColumn::class, ['label' => 'name.label', |
61 | - 'render' => function ($value, Part $context) { |
|
61 | + 'render' => function($value, Part $context) { |
|
62 | 62 | return $this->urlGenerator->infoHTML($context); |
63 | - }, ]) |
|
63 | + },]) |
|
64 | 64 | ->add('description', TextColumn::class, ['label' => 'description.label']) |
65 | 65 | ->add('category', TextColumn::class, ['field' => 'category.name', 'label' => 'category.label']) |
66 | 66 | ->add('instock', TextColumn::class, ['label' => 'instock.label_short']) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ->createAdapter(ORMAdapter::class, [ |
71 | 71 | 'entity' => Part::class, |
72 | 72 | 'criteria' => [ |
73 | - function (QueryBuilder $builder) use ($options) { |
|
73 | + function(QueryBuilder $builder) use ($options) { |
|
74 | 74 | if (isset($options['cid'])) { |
75 | 75 | $builder->andWhere('part.category = :cid') |
76 | 76 | ->setParameter('cid', $options['cid']); |
@@ -64,7 +64,7 @@ |
||
64 | 64 | 'disabled' => !$this->security->isGranted('name.edit', $part), ]) |
65 | 65 | ->add('description', TextType::class, ['required' => false, 'empty_data' => '', |
66 | 66 | 'label' => 'description.label', 'help' => 'bbcode.hint', 'attr' => ['placeholder' => 'part.description.placeholder'], |
67 | - 'disabled' => !$this->security->isGranted('description.edit', $part), 'empty_data' => '' ]) |
|
67 | + 'disabled' => !$this->security->isGranted('description.edit', $part), 'empty_data' => '']) |
|
68 | 68 | ->add('instock', IntegerType::class, |
69 | 69 | ['attr' => ['min' => 0, 'placeholder' => 'part.instock.placeholder'], 'label' => 'instock.label', |
70 | 70 | 'disabled' => !$this->security->isGranted('instock.edit', $part), ]) |
@@ -179,7 +179,7 @@ |
||
179 | 179 | */ |
180 | 180 | public function listOperationsForPermission(string $permission): array |
181 | 181 | { |
182 | - if(!$this->isValidPermission($permission)) { |
|
182 | + if (!$this->isValidPermission($permission)) { |
|
183 | 183 | throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission)); |
184 | 184 | } |
185 | 185 | $operations = $this->permission_structure['perms'][$permission]['operations']; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function getBitValue(string $permission_name, int $bit_n): int |
275 | 275 | { |
276 | - if(!$this->isValidPermissionName($permission_name)) { |
|
276 | + if (!$this->isValidPermissionName($permission_name)) { |
|
277 | 277 | throw new \InvalidArgumentException('No permission with the given name is existing!'); |
278 | 278 | } |
279 | 279 | |
@@ -317,9 +317,9 @@ discard block |
||
317 | 317 | public function setPermissionValue(string $permission_name, int $bit_n, ?bool $new_value) : self |
318 | 318 | { |
319 | 319 | //Determine which bit value the given value is. |
320 | - if($new_value === true) { |
|
320 | + if ($new_value === true) { |
|
321 | 321 | $bit_value = static::ALLOW; |
322 | - } elseif($new_value === false) { |
|
322 | + } elseif ($new_value === false) { |
|
323 | 323 | $bit_value = static::DISALLOW; |
324 | 324 | } else { |
325 | 325 | $bit_value = static::INHERIT; |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public function setBitValue(string $permission_name, int $bit_n, int $new_value) : self |
341 | 341 | { |
342 | - if(!$this->isValidPermissionName($permission_name)) { |
|
342 | + if (!$this->isValidPermissionName($permission_name)) { |
|
343 | 343 | throw new \InvalidArgumentException('No permission with the given name is existing!'); |
344 | 344 | } |
345 | 345 |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | $tree_node = new TreeViewNode($element->getName(), $href, $children_nodes); |
86 | 86 | |
87 | - if($children_nodes != null) { |
|
87 | + if ($children_nodes != null) { |
|
88 | 88 | $tree_node->addTag((string) count($children_nodes)); |
89 | 89 | } |
90 | 90 |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return $this->urlGenerator->generate('part_edit', ['id' => $entity->getID()]); |
111 | 111 | } |
112 | 112 | |
113 | - if($entity instanceof AttachmentType) { |
|
113 | + if ($entity instanceof AttachmentType) { |
|
114 | 114 | return $this->urlGenerator->generate('attachment_type_edit', ['id' => $entity->getID()]); |
115 | 115 | } |
116 | 116 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $this->urlGenerator->generate('part_new'); |
132 | 132 | } |
133 | 133 | |
134 | - if($entity instanceof AttachmentType) { |
|
134 | + if ($entity instanceof AttachmentType) { |
|
135 | 135 | return $this->urlGenerator->generate('attachment_type_new'); |
136 | 136 | } |
137 | 137 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | public function deleteURL($entity) : string |
175 | 175 | { |
176 | - if($entity instanceof AttachmentType) { |
|
176 | + if ($entity instanceof AttachmentType) { |
|
177 | 177 | return $this->urlGenerator->generate('attachment_type_delete', ['id' => $entity->getID()]); |
178 | 178 | } |
179 | 179 |
@@ -77,6 +77,6 @@ |
||
77 | 77 | */ |
78 | 78 | public function getIDString(): string |
79 | 79 | { |
80 | - return 'AT' . sprintf('%09d', $this->getID()); |
|
80 | + return 'AT'.sprintf('%09d', $this->getID()); |
|
81 | 81 | } |
82 | 82 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | //Ensure that we always serialize an array. This makes it easier to import the data again. |
100 | - if(is_array($entity)) { |
|
100 | + if (is_array($entity)) { |
|
101 | 101 | $entity_array = $entity; |
102 | 102 | } else { |
103 | 103 | $entity_array = [$entity]; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | |
133 | - $filename = "export_" . $entity_name . "_" . $level . "." . $format; |
|
133 | + $filename = "export_".$entity_name."_".$level.".".$format; |
|
134 | 134 | |
135 | 135 | // Create the disposition of the file |
136 | 136 | $disposition = $response->headers->makeDisposition( |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | foreach ($errors as $name => $error) { |
123 | 123 | /** @var $error ConstraintViolationList */ |
124 | - $this->addFlash('error', $name . ":" . $error); |
|
124 | + $this->addFlash('error', $name.":".$error); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | $entities = $em->getRepository(AttachmentType::class)->findAll(); |
174 | 174 | |
175 | - return $exporter->exportEntityFromRequest($entities,$request); |
|
175 | + return $exporter->exportEntityFromRequest($entities, $request); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |