Passed
Push — develop ( 239bf5...ca305c )
by Szymon
02:23 queued 10s
created
src/Controller/Plugin/Notification.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     /**
59 59
      * @var array
60 60
      */
61
-    protected $notifications = [];
61
+    protected $notifications = [ ];
62 62
 
63 63
     /**
64 64
      * @var bool
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
     public function get($namespace)
197 197
     {
198 198
         if ($this->has($namespace)) {
199
-            return $this->notifications[$namespace]->toArray();
199
+            return $this->notifications[ $namespace ]->toArray();
200 200
         }
201 201
 
202
-        return [];
202
+        return [ ];
203 203
     }
204 204
 
205 205
     /**
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
     {
253 253
         $this->getNotificationsFromContainer();
254 254
 
255
-        return isset($this->notifications[$namespace]);
255
+        return isset($this->notifications[ $namespace ]);
256 256
     }
257 257
 
258 258
     /**
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             return $container->{$namespace}->toArray();
300 300
         }
301 301
 
302
-        return [];
302
+        return [ ];
303 303
     }
304 304
 
305 305
     /**
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
      */
310 310
     public function getAllCurrent()
311 311
     {
312
-        $notifications = [];
312
+        $notifications = [ ];
313 313
         $container = $this->getContainer();
314 314
 
315 315
         foreach ($container as $namespace => $notification) {
316
-            $notifications[$namespace] = $this->getCurrent($namespace);
316
+            $notifications[ $namespace ] = $this->getCurrent($namespace);
317 317
         }
318 318
 
319 319
         return $notifications;
@@ -435,15 +435,15 @@  discard block
 block discarded – undo
435 435
         }
436 436
 
437 437
         // If user called add method then we have to check if he provided notification text
438
-        if (!isset($arguments[0]) || !is_string($arguments[0])) {
438
+        if (!isset($arguments[ 0 ]) || !is_string($arguments[ 0 ])) {
439 439
             throw new \InvalidArgumentException(sprintf(
440 440
                 '%s method must contains notification text, %s given.',
441 441
                 $name,
442
-                isset($arguments[0]) ? gettype($arguments[0]) : null
442
+                isset($arguments[ 0 ]) ? gettype($arguments[ 0 ]) : null
443 443
             ));
444 444
         }
445 445
 
446
-        $this->$method($namespace, $arguments[0]);
446
+        $this->$method($namespace, $arguments[ 0 ]);
447 447
         return $this;
448 448
     }
449 449
 
@@ -457,11 +457,11 @@  discard block
 block discarded – undo
457 457
         }
458 458
 
459 459
         $container = $this->getContainer();
460
-        $namespaces = [];
460
+        $namespaces = [ ];
461 461
 
462 462
         foreach ($container as $namespace => $notification) {
463
-            $this->notifications[$namespace] = $notification;
464
-            $namespaces[] = $namespace;
463
+            $this->notifications[ $namespace ] = $notification;
464
+            $namespaces[ ] = $namespace;
465 465
         }
466 466
 
467 467
         $this->clearNotificationsFromContainer($namespaces);
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
      */
473 473
     protected function clearNotificationsFromContainer($namespaces)
474 474
     {
475
-        $namespaces = is_array($namespaces) ? $namespaces : [$namespaces];
475
+        $namespaces = is_array($namespaces) ? $namespaces : [ $namespaces ];
476 476
         $container = $this->getContainer();
477 477
 
478 478
         foreach ($namespaces as $namespace) {
@@ -519,8 +519,8 @@  discard block
 block discarded – undo
519 519
         $this->getNotificationsFromContainer();
520 520
 
521 521
         if ($namespace) {
522
-            if (isset($this->notifications[$namespace])) {
523
-                unset($this->notifications[$namespace]);
522
+            if (isset($this->notifications[ $namespace ])) {
523
+                unset($this->notifications[ $namespace ]);
524 524
                 return true;
525 525
             }
526 526
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
         }
529 529
 
530 530
         foreach ($this->notifications as $nm => $type) {
531
-            unset($this->notifications[$nm]);
531
+            unset($this->notifications[ $nm ]);
532 532
         }
533 533
 
534 534
         return true;
Please login to merge, or discard this patch.