Passed
Push — master ( 782e2b...0f3ba9 )
by Jan
02:56
created
src/Controller/UserController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
     public function userInfo(?User $user, Packages $packages)
57 57
     {
58 58
         //If no user id was passed, then we show info about the current user
59
-        if($user === null) {
59
+        if ($user === null) {
60 60
             $user = $this->getUser();
61 61
         } else {
62 62
             //Else we must check, if the current user is allowed to access $user
63 63
             $this->denyAccessUnlessGranted('read', $user);
64 64
         }
65 65
 
66
-        if($this->getParameter('use_gravatar')) {
66
+        if ($this->getParameter('use_gravatar')) {
67 67
             $avatar = $this->getGravatar($user->getEmail(), 200, 'identicon');
68 68
         } else {
69 69
             $avatar = $packages->getUrl('/img/default_avatar.png');
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $pw_form->handleRequest($request);
128 128
 
129 129
         //Check if password if everything was correct, then save it to User and DB
130
-        if($pw_form->isSubmitted() && $pw_form->isValid()) {
130
+        if ($pw_form->isSubmitted() && $pw_form->isValid()) {
131 131
             $password = $passwordEncoder->encodePassword($user, $pw_form['new_password']->getData());
132 132
             $user->setPassword($password);
133 133
             $em->persist($user);
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
         $url .= md5(strtolower(trim($email)));
165 165
         $url .= "?s=$s&d=$d&r=$r";
166 166
         if ($img) {
167
-            $url = '<img src="' . $url . '"';
167
+            $url = '<img src="'.$url.'"';
168 168
             foreach ($atts as $key => $val) {
169
-                $url .= ' ' . $key . '="' . $val . '"';
169
+                $url .= ' '.$key.'="'.$val.'"';
170 170
             }
171 171
             $url .= ' />';
172 172
         }
Please login to merge, or discard this patch.
src/Entity/AttachmentContainingDBElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
             $attachements = $this->attachments;
78 78
 
79 79
             foreach ($attachements as $key => $attachement) {
80
-                if (($only_table_attachements && (! $attachement->getShowInTable()))
80
+                if (($only_table_attachements && (!$attachement->getShowInTable()))
81 81
                     || ($type_id && ($attachement->getType()->getID() !== $type_id))) {
82 82
                     unset($attachements[$key]);
83 83
                 }
Please login to merge, or discard this patch.
src/Entity/StructuralDBElement.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     /**
74 74
      * @var int
75 75
      */
76
-    protected $level=0;
76
+    protected $level = 0;
77 77
 
78 78
     /** @var string[] all names of all parent elements as a array of strings,
79 79
      *  the last array element is the name of the element itself */
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function getFullPath(string $delimeter = self::PATH_DELIMITER_ARROW) : string
190 190
     {
191
-        if (! \is_array($this->full_path_strings)) {
191
+        if (!\is_array($this->full_path_strings)) {
192 192
             $this->full_path_strings = array();
193 193
             $this->full_path_strings[] = $this->getName();
194 194
             $element = $this;
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             $this->children = new ArrayCollection();
218 218
         }
219 219
 
220
-        if (! $recursive) {
220
+        if (!$recursive) {
221 221
             return $this->children;
222 222
         } else {
223 223
             $all_elements = array();
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
                 $root_name = htmlspecialchars($this->getName());
303 303
             }
304 304
 
305
-            $html[] = '<option value="'. $value_prefix . $this->getID() . '">' . $root_name . '</option>';
305
+            $html[] = '<option value="'.$value_prefix.$this->getID().'">'.$root_name.'</option>';
306 306
         } else {
307
-            $root_level =  $this->getLevel() + 1;
307
+            $root_level = $this->getLevel() + 1;
308 308
         }
309 309
 
310 310
         // get all subelements
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
             $level = $element->getLevel() - $root_level;
315 315
             $selected = ($element->getID() == $selected_id) ? 'selected' : '';
316 316
 
317
-            $html[] = '<option ' . $selected . ' value="' . $value_prefix . $element->getID() . '">';
317
+            $html[] = '<option '.$selected.' value="'.$value_prefix.$element->getID().'">';
318 318
             for ($i = 0; $i < $level; $i++) {
319 319
                 $html[] = '&nbsp;&nbsp;&nbsp;';
320 320
             }
321
-            $html[] = htmlspecialchars($element->getName()) . '</option>';
321
+            $html[] = htmlspecialchars($element->getName()).'</option>';
322 322
         }
323 323
 
324 324
         return implode("\n", $html);
@@ -349,8 +349,8 @@  discard block
 block discarded – undo
349 349
         if ($this->getParentID() == -1) {
350 350
             if ($show_root) {
351 351
                 $tree = array(
352
-                    array('text' => $use_db_root_name ? htmlspecialchars($this->getName()) : $root_name ,
353
-                        'href' => $page . '?' . $parameter . '=' . $this->getID(),
352
+                    array('text' => $use_db_root_name ? htmlspecialchars($this->getName()) : $root_name,
353
+                        'href' => $page.'?'.$parameter.'='.$this->getID(),
354 354
                         'nodes' => $nodes)
355 355
                 );
356 356
             } else { //Dont show root node
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
             }
359 359
         } elseif (!empty($nodes)) {
360 360
             $tree = array('text' => htmlspecialchars($this->getName()),
361
-                'href' => $page . '?' . $parameter . '=' . $this->getID(),
361
+                'href' => $page.'?'.$parameter.'='.$this->getID(),
362 362
                 'nodes' => $nodes
363 363
             );
364 364
         } else {
365 365
             $tree = array('text' => htmlspecialchars($this->getName()),
366
-                'href' => $page . '?' . $parameter . '=' .  $this->getID()
366
+                'href' => $page.'?'.$parameter.'='.$this->getID()
367 367
             );
368 368
         }
369 369
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
         $tmp = array();
401 401
 
402 402
         if ($element_is_link) {
403
-            $tmp[] = array('label' => $this->getName(), 'href' => $page . '?' . $parameter . '=' .$this->getID(), 'selected' => true);
403
+            $tmp[] = array('label' => $this->getName(), 'href' => $page.'?'.$parameter.'='.$this->getID(), 'selected' => true);
404 404
         } else {
405 405
             $tmp[] = array('label' => $this->getName(), 'selected' => true);
406 406
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             /** @var StructuralDBElement $element */
411 411
             $element = static::getInstance($this->database, $this->current_user, $this->log, $parent_id);
412 412
             $parent_id = $element->getParentID();
413
-            $tmp[] = array('label' => $element->getName(), 'href' => $page . '?' . $parameter . '=' . $element->getID());
413
+            $tmp[] = array('label' => $element->getName(), 'href' => $page.'?'.$parameter.'='.$element->getID());
414 414
         }
415 415
         $tmp = array_reverse($tmp);
416 416
 
Please login to merge, or discard this patch.
src/Entity/User.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 class User extends NamedDBElement implements UserInterface, HasPermissionsInterface
49 49
 {
50 50
     /** The User id of the anonymous user */
51
-    public const ID_ANONYMOUS      = 1;
51
+    public const ID_ANONYMOUS = 1;
52 52
 
53 53
     /**
54 54
      * @ORM\Id()
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      */
222 222
     public function getIDString(): string
223 223
     {
224
-        return 'U' . sprintf('%06d', $this->getID());
224
+        return 'U'.sprintf('%06d', $this->getID());
225 225
     }
226 226
 
227 227
 
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
      */
243 243
     public function getFullName(bool $including_username = false) : string
244 244
     {
245
-        $str = $this->getFirstName() . ' ' . $this->getLastName();
245
+        $str = $this->getFirstName().' '.$this->getLastName();
246 246
         if ($including_username) {
247
-            $str .= ' (' . $this->getName() . ')';
247
+            $str .= ' ('.$this->getName().')';
248 248
         }
249 249
 
250 250
         return $str;
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     public function setName(string $new_name) : NamedDBElement
255 255
     {
256 256
         // Anonymous user is not allowed to change its username
257
-        if(!$this->isAnonymousUser()) {
257
+        if (!$this->isAnonymousUser()) {
258 258
             $this->name = $new_name;
259 259
         }
260 260
 
Please login to merge, or discard this patch.
src/Entity/Attachment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
      */
150 150
     public function getIDString(): string
151 151
     {
152
-        return 'A' . sprintf('%09d', $this->getID());
152
+        return 'A'.sprintf('%09d', $this->getID());
153 153
     }
154 154
 
155 155
     /*****************************************************************************************************
Please login to merge, or discard this patch.
src/Entity/PermissionsEmbed.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             return true;
288 288
         }
289 289
 
290
-        if($value == self::DISALLOW) {
290
+        if ($value == self::DISALLOW) {
291 291
             return false;
292 292
         } else {
293 293
             return null;
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     final protected static function readBitPair(int $data, int $n): int
304 304
     {
305
-        Assert::lessThanEq($n,31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
305
+        Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
306 306
         if ($n % 2 !== 0) {
307 307
             throw new \InvalidArgumentException('$n must be dividable by 2, because we address bit pairs here!');
308 308
         }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
      */
321 321
     final protected static function writeBitPair(int $data, int $n, int $new) : int
322 322
     {
323
-        Assert::lessThanEq($n,31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
323
+        Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
324 324
         Assert::lessThanEq($new, 3, '$new must be smaller than 3, because a bit pair is written! Got %s.');
325 325
 
326 326
         if ($n % 2 !== 0) {
Please login to merge, or discard this patch.
src/Entity/Part.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
  */
50 50
 class Part extends AttachmentContainingDBElement
51 51
 {
52
-    public const INSTOCK_UNKNOWN   = -2;
52
+    public const INSTOCK_UNKNOWN = -2;
53 53
 
54 54
     /**
55 55
      * @var Category
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
      */
216 216
     public function getIDString(): string
217 217
     {
218
-        return 'P' . sprintf('%06d', $this->getID());
218
+        return 'P'.sprintf('%06d', $this->getID());
219 219
     }
220 220
 
221 221
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         }
293 293
 
294 294
         foreach ($all_orderdetails as $orderdetails) {
295
-            if (! $orderdetails->getObsolete()) {
295
+            if (!$orderdetails->getObsolete()) {
296 296
                 return false;
297 297
             }
298 298
         }
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         $prices = array();
656 656
 
657 657
         foreach ($this->getOrderdetails($hide_obsolete) as $details) {
658
-            $prices[] = $details->getPrice(! $float_array, $quantity, $multiplier);
658
+            $prices[] = $details->getPrice(!$float_array, $quantity, $multiplier);
659 659
         }
660 660
 
661 661
         if (\is_string($delimeter)) {
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
      */
863 863
     public function setInstockUnknown(bool $new_unknown) : self
864 864
     {
865
-        if($new_unknown === true) {
865
+        if ($new_unknown === true) {
866 866
             $this->instock = self::INSTOCK_UNKNOWN;
867 867
         } else if ($this->isInstockUnknown()) {
868 868
             $this->setInstock(0);
Please login to merge, or discard this patch.
src/Entity/Device.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function setOrderQuantity(int $new_order_quantity) : self
114 114
     {
115
-        if($new_order_quantity < 0)
115
+        if ($new_order_quantity < 0)
116 116
         {
117 117
             throw new \InvalidArgumentException('The new order quantity must not be negative!');
118 118
         }
@@ -139,6 +139,6 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function getIDString(): string
141 141
     {
142
-        return 'D' . sprintf('%09d', $this->getID());
142
+        return 'D'.sprintf('%09d', $this->getID());
143 143
     }
144 144
 }
145 145
\ No newline at end of file
Please login to merge, or discard this patch.