@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function getTests() |
87 | 87 | { |
88 | 88 | return [ |
89 | - new TwigTest('instanceof', function ($var, $instance) { |
|
89 | + new TwigTest('instanceof', function($var, $instance) { |
|
90 | 90 | return $var instanceof $instance; |
91 | 91 | } ) |
92 | 92 | ]; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function loginPath(string $path) : string |
114 | 114 | { |
115 | - $parts = explode("/" ,$path); |
|
115 | + $parts = explode("/", $path); |
|
116 | 116 | //Remove the part with |
117 | 117 | unset($parts[1]); |
118 | 118 | return implode("/", $parts); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | self::$utc ? self::$utc : self::$utc = new \DateTimeZone('UTC') |
66 | 66 | ); |
67 | 67 | |
68 | - if (! $converted) { |
|
68 | + if (!$converted) { |
|
69 | 69 | throw ConversionException::conversionFailedFormat( |
70 | 70 | $value, |
71 | 71 | $this->getName(), |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function getBitValue(string $permission_name, int $bit_n): int |
316 | 316 | { |
317 | - if(!$this->isValidPermissionName($permission_name)) { |
|
317 | + if (!$this->isValidPermissionName($permission_name)) { |
|
318 | 318 | throw new \InvalidArgumentException(sprintf('No permission with the name "%s" is existing!', $permission_name)); |
319 | 319 | } |
320 | 320 | |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | public function setPermissionValue(string $permission_name, int $bit_n, ?bool $new_value) : self |
359 | 359 | { |
360 | 360 | //Determine which bit value the given value is. |
361 | - if($new_value === true) { |
|
361 | + if ($new_value === true) { |
|
362 | 362 | $bit_value = static::ALLOW; |
363 | - } elseif($new_value === false) { |
|
363 | + } elseif ($new_value === false) { |
|
364 | 364 | $bit_value = static::DISALLOW; |
365 | 365 | } else { |
366 | 366 | $bit_value = static::INHERIT; |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | */ |
381 | 381 | public function setBitValue(string $permission_name, int $bit_n, int $new_value) : self |
382 | 382 | { |
383 | - if(!$this->isValidPermissionName($permission_name)) { |
|
383 | + if (!$this->isValidPermissionName($permission_name)) { |
|
384 | 384 | throw new \InvalidArgumentException('No permission with the given name is existing!'); |
385 | 385 | } |
386 | 386 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | if (false !== strpos($attribute, '.')) { |
27 | 27 | [$perm, $op] = explode('.', $attribute); |
28 | 28 | |
29 | - return $this->resolver->isValidOperation('parts_' . $perm, $op); |
|
29 | + return $this->resolver->isValidOperation('parts_'.$perm, $op); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | return $this->resolver->isValidOperation('parts', $attribute); |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | protected function supports($attribute, $subject) |
58 | 58 | { |
59 | - if(is_object($subject)) { |
|
59 | + if (is_object($subject)) { |
|
60 | 60 | $permission_name = $this->instanceToPermissionName($subject); |
61 | 61 | //If permission name is null, then the subject is not supported |
62 | 62 | return ($permission_name !== null) && $this->resolver->isValidOperation($permission_name, $attribute); |
@@ -81,13 +81,13 @@ |
||
81 | 81 | { |
82 | 82 | parent::configureOptions($resolver); |
83 | 83 | |
84 | - $resolver->setDefault('group_name', function (Options $options) { |
|
84 | + $resolver->setDefault('group_name', function(Options $options) { |
|
85 | 85 | return trim($options['name']); |
86 | 86 | }); |
87 | 87 | |
88 | 88 | $resolver->setDefault('inherit', false); |
89 | 89 | |
90 | - $resolver->setDefault('label', function (Options $options) { |
|
90 | + $resolver->setDefault('label', function(Options $options) { |
|
91 | 91 | if (!empty($this->perm_structure['groups'][$options['group_name']]['label'])) { |
92 | 92 | return $this->perm_structure['groups'][$options['group_name']]['label']; |
93 | 93 | } |
@@ -71,12 +71,12 @@ |
||
71 | 71 | |
72 | 72 | $resolver->setRequired('property'); |
73 | 73 | |
74 | - $resolver->setDefault('field', function (Options $option) { |
|
75 | - return $option['property'] . '.name'; |
|
74 | + $resolver->setDefault('field', function(Options $option) { |
|
75 | + return $option['property'].'.name'; |
|
76 | 76 | }); |
77 | 77 | |
78 | - $resolver->setDefault('render', function (Options $options) { |
|
79 | - return function ($value, Part $context) use ($options) { |
|
78 | + $resolver->setDefault('render', function(Options $options) { |
|
79 | + return function($value, Part $context) use ($options) { |
|
80 | 80 | /** @var DBElement $entity */ |
81 | 81 | $entity = $this->accessor->getValue($context, $options['property']); |
82 | 82 |
@@ -138,7 +138,7 @@ |
||
138 | 138 | */ |
139 | 139 | public function getIDString(): string |
140 | 140 | { |
141 | - return 'P' . sprintf('%06d', $this->getID()); |
|
141 | + return 'P'.sprintf('%06d', $this->getID()); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $attachments = $form['attachments']; |
91 | 91 | foreach ($attachments as $attachment) { |
92 | 92 | /** @var $attachment FormInterface */ |
93 | - $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData()); |
|
93 | + $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData()); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->addFlash('info', $translator->trans('part.edited_flash')); |
100 | 100 | //Reload form, so the SIUnitType entries use the new part unit |
101 | 101 | $form = $this->createForm(PartBaseType::class, $part); |
102 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
102 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
103 | 103 | $this->addFlash('error', $translator->trans('part.edited_flash.invalid')); |
104 | 104 | } |
105 | 105 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | $this->denyAccessUnlessGranted('delete', $part); |
123 | 123 | |
124 | - if ($this->isCsrfTokenValid('delete' . $part->getId(), $request->request->get('_token'))) { |
|
124 | + if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) { |
|
125 | 125 | $entityManager = $this->getDoctrine()->getManager(); |
126 | 126 | |
127 | 127 | //Remove part |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $attachments = $form['attachments']; |
166 | 166 | foreach ($attachments as $attachment) { |
167 | 167 | /** @var $attachment FormInterface */ |
168 | - $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData()); |
|
168 | + $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData()); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $em->persist($new_part); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
176 | 176 | } |
177 | 177 | |
178 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
178 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
179 | 179 | $this->addFlash('error', $translator->trans('part.created_flash.invalid')); |
180 | 180 | } |
181 | 181 |