@@ -66,7 +66,7 @@ |
||
66 | 66 | } else { |
67 | 67 | // We have to sort the pricedetails manually |
68 | 68 | $array = $pricedetails->map( |
69 | - function (Pricedetail $pricedetail) { |
|
69 | + function(Pricedetail $pricedetail) { |
|
70 | 70 | return $pricedetail->getMinDiscountQuantity(); |
71 | 71 | } |
72 | 72 | )->toArray(); |
@@ -79,7 +79,7 @@ |
||
79 | 79 | public function getTests() |
80 | 80 | { |
81 | 81 | return [ |
82 | - new TwigTest('instanceof', function ($var, $instance) { |
|
82 | + new TwigTest('instanceof', function($var, $instance) { |
|
83 | 83 | return $var instanceof $instance; |
84 | 84 | }), |
85 | 85 | ]; |
@@ -176,7 +176,6 @@ |
||
176 | 176 | |
177 | 177 | /** |
178 | 178 | * Get the comment of the element. |
179 | - |
|
180 | 179 | * |
181 | 180 | * @return string the comment |
182 | 181 | */ |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | //Check if both elements compared, are from the same type |
126 | 126 | // (we have to check inheritance, or we get exceptions when using doctrine entities (they have a proxy type): |
127 | - if (! is_a($another_element, $class_name) && ! is_a($this, get_class($another_element))) { |
|
127 | + if (!is_a($another_element, $class_name) && !is_a($this, get_class($another_element))) { |
|
128 | 128 | throw new InvalidArgumentException('isChildOf() only works for objects of the same type!'); |
129 | 129 | } |
130 | 130 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $tmp[] = $this; |
241 | 241 | |
242 | 242 | //We only allow 20 levels depth |
243 | - while (! end($tmp)->isRoot() && count($tmp) < 20) { |
|
243 | + while (!end($tmp)->isRoot() && count($tmp) < 20) { |
|
244 | 244 | $tmp[] = end($tmp)->parent; |
245 | 245 | } |
246 | 246 |
@@ -60,12 +60,12 @@ |
||
60 | 60 | |
61 | 61 | $resolver->setRequired('property'); |
62 | 62 | |
63 | - $resolver->setDefault('field', function (Options $option) { |
|
63 | + $resolver->setDefault('field', function(Options $option) { |
|
64 | 64 | return $option['property'].'.name'; |
65 | 65 | }); |
66 | 66 | |
67 | - $resolver->setDefault('render', function (Options $options) { |
|
68 | - return function ($value, Part $context) use ($options) { |
|
67 | + $resolver->setDefault('render', function(Options $options) { |
|
68 | + return function($value, Part $context) use ($options) { |
|
69 | 69 | /** @var DBElement $entity */ |
70 | 70 | $entity = $this->accessor->getValue($context, $options['property']); |
71 | 71 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | { |
78 | 78 | $key = 'tree_tools_'.$this->keyGenerator->generateKey(); |
79 | 79 | |
80 | - return $this->cache->get($key, function (ItemInterface $item) { |
|
80 | + return $this->cache->get($key, function(ItemInterface $item) { |
|
81 | 81 | //Invalidate tree, whenever group or the user changes |
82 | 82 | $item->tag(['tree_tools', 'groups', $this->keyGenerator->generateKey()]); |
83 | 83 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $crawler = $client->request('GET', static::$base_path.'/new'); |
72 | 72 | $this->assertFalse($client->getResponse()->isRedirect()); |
73 | 73 | $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!'); |
74 | - $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
74 | + $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $crawler = $client->request('GET', static::$base_path.'/1'); |
97 | 97 | $this->assertFalse($client->getResponse()->isRedirect()); |
98 | 98 | $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!'); |
99 | - $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
99 | + $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | public function deleteDataProvider() |
@@ -133,6 +133,6 @@ discard block |
||
133 | 133 | |
134 | 134 | //Page is redirected to '/new', when delete was successful |
135 | 135 | $this->assertSame($delete, $client->getResponse()->isRedirect(static::$base_path.'/new')); |
136 | - $this->assertSame($delete, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
136 | + $this->assertSame($delete, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
137 | 137 | } |
138 | 138 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->addFlash('info', 'part.edited_flash'); |
104 | 104 | //Reload form, so the SIUnitType entries use the new part unit |
105 | 105 | $form = $this->createForm(PartBaseType::class, $part); |
106 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
106 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
107 | 107 | $this->addFlash('error', 'part.edited_flash.invalid'); |
108 | 108 | } |
109 | 109 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
190 | 190 | } |
191 | 191 | |
192 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
192 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
193 | 193 | $this->addFlash('error', 'part.created_flash.invalid'); |
194 | 194 | } |
195 | 195 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function requestPwReset(PasswordResetManager $passwordReset, Request $request) |
74 | 74 | { |
75 | - if (! $this->allow_email_pw_reset) { |
|
75 | + if (!$this->allow_email_pw_reset) { |
|
76 | 76 | throw new AccessDeniedHttpException('The password reset via email is disabled!'); |
77 | 77 | } |
78 | 78 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function pwResetNewPw(PasswordResetManager $passwordReset, Request $request, ?string $user = null, ?string $token = null) |
116 | 116 | { |
117 | - if (! $this->allow_email_pw_reset) { |
|
117 | + if (!$this->allow_email_pw_reset) { |
|
118 | 118 | throw new AccessDeniedHttpException('The password reset via email is disabled!'); |
119 | 119 | } |
120 | 120 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $data = $form->getData(); |
153 | 153 | //Try to set the new password |
154 | 154 | $success = $passwordReset->setNewPassword($data['username'], $data['token'], $data['new_password']); |
155 | - if (! $success) { |
|
155 | + if (!$success) { |
|
156 | 156 | $this->addFlash('error', 'pw_reset.new_pw.error'); |
157 | 157 | } else { |
158 | 158 | $this->addFlash('success', 'pw_reset.new_pw.success'); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $form->handleRequest($request); |
84 | 84 | if ($form->isSubmitted() && $form->isValid()) { |
85 | 85 | //Check if we editing a user and if we need to change the password of it |
86 | - if ($entity instanceof User && ! empty($form['new_password']->getData())) { |
|
86 | + if ($entity instanceof User && !empty($form['new_password']->getData())) { |
|
87 | 87 | $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData()); |
88 | 88 | $entity->setPassword($password); |
89 | 89 | //By default the user must change the password afterwards |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | //Rebuild form, so it is based on the updated data. Important for the parent field! |
117 | 117 | //We can not use dynamic form events here, because the parent entity list is build from database! |
118 | 118 | $form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]); |
119 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
119 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
120 | 120 | $this->addFlash('error', 'entity.edit_flash.invalid'); |
121 | 121 | } |
122 | 122 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $form->handleRequest($request); |
141 | 141 | |
142 | 142 | if ($form->isSubmitted() && $form->isValid()) { |
143 | - if ($new_entity instanceof User && ! empty($form['new_password']->getData())) { |
|
143 | + if ($new_entity instanceof User && !empty($form['new_password']->getData())) { |
|
144 | 144 | $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData()); |
145 | 145 | $new_entity->setPassword($password); |
146 | 146 | //By default the user must change the password afterwards |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); |
174 | 174 | } |
175 | 175 | |
176 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
176 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
177 | 177 | $this->addFlash('error', 'entity.created_flash.invalid'); |
178 | 178 | } |
179 | 179 |