Test Failed
Branch master (d02fed)
by Jinyun
07:13
created
src/Behavioral/ChainOfResponsibility/DatabaseHandler.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 use Psr\Http\Message\RequestInterface;
6 6
 
7
-class DatabaseHandler extends Handler
8
-{
7
+class DatabaseHandler extends Handler
8
+{
9 9
     /**
10 10
      * Database processing.
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Observer/Npl/SubjectInterface.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Observer\Npl;
6 6
 
7
-interface SubjectInterface
8
-{
7
+interface SubjectInterface
8
+{
9 9
     /**
10 10
      * Attach an ObserverInterface.
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Observer/Npl/Subject.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function attach(ObserverInterface $observer)
41 41
     {
42
-        if (! in_array($observer, $this->observers, true)) {
42
+        if ( ! in_array($observer, $this->observers, true)) {
43 43
             $this->observers[] = $observer;
44 44
         }
45 45
     }
Please login to merge, or discard this patch.
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Observer\Npl;
6 6
 
7
-class Subject implements SubjectInterface
8
-{
7
+class Subject implements SubjectInterface
8
+{
9 9
     /**
10 10
      * @var string
11 11
      */
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @param  string  $name
28 28
      */
29
-    public function __construct(string $name = '')
30
-    {
29
+    public function __construct(string $name = '')
30
+    {
31 31
         $this->name = $name;
32 32
         $this->observers = [];
33 33
     }
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @param  \DesignPattern\Behavioral\Observer\Npl\ObserverInterface  $observer
39 39
      */
40
-    public function attach(ObserverInterface $observer)
41
-    {
42
-        if (! in_array($observer, $this->observers, true)) {
40
+    public function attach(ObserverInterface $observer)
41
+    {
42
+        if (! in_array($observer, $this->observers, true)) {
43 43
             $this->observers[] = $observer;
44 44
         }
45 45
     }
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @param  \DesignPattern\Behavioral\Observer\Npl\ObserverInterface  $observer
51 51
      */
52
-    public function detach(ObserverInterface $observer)
53
-    {
52
+    public function detach(ObserverInterface $observer)
53
+    {
54 54
         $key = array_search($observer, $this->observers, true);
55
-        if ($key !== false) {
55
+        if ($key !== false) {
56 56
             unset($this->observers[$key]);
57 57
         }
58 58
     }
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
     /**
61 61
      * Notify an observer.
62 62
      */
63
-    public function notify()
64
-    {
63
+    public function notify()
64
+    {
65 65
         /** @var \DesignPattern\Behavioral\Observer\Npl\Observer $observer */
66
-        foreach ($this->observers as $observer) {
66
+        foreach ($this->observers as $observer) {
67 67
             $observer->update($this);
68 68
         }
69 69
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function doSomethingReport(): void
77 77
     {
78 78
         /** @var \DesignPattern\Behavioral\Observer\Npl\Observer $observer */
79
-        foreach ($this->observers as $observer) {
79
+        foreach ($this->observers as $observer) {
80 80
             $observer->report(random_int(20, 29), 'Something happened.', $this);
81 81
         }
82 82
     }
Please login to merge, or discard this patch.
src/Behavioral/Observer/Npl/Observer.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Observer\Npl;
6 6
 
7
-class Observer implements ObserverInterface
8
-{
7
+class Observer implements ObserverInterface
8
+{
9 9
     /**
10 10
      * Receive update from subject.
11 11
      *
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      *
14 14
      * @return mixed|void
15 15
      */
16
-    public function update(SubjectInterface $subject)
17
-    {
16
+    public function update(SubjectInterface $subject)
17
+    {
18 18
         echo sprintf('Subject author is %s.', $subject->getAuthor());
19 19
     }
20 20
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         int $code,
32 32
         string $message,
33 33
         SubjectInterface $subject
34
-    ) {
34
+    ) {
35 35
         // TODO: Implement report() method.
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
src/Behavioral/Observer/Npl/ObserverInterface.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Observer\Npl;
6 6
 
7
-interface ObserverInterface
8
-{
7
+interface ObserverInterface
8
+{
9 9
     /**
10 10
      * Receive update from subject.
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Observer/Spl/ProductObserver.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Observer\Spl;
6 6
 
7
-class ProductObserver implements \SplObserver
8
-{
7
+class ProductObserver implements \SplObserver
8
+{
9 9
     /**
10 10
      * Update product price.
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Memento/History.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Memento;
6 6
 
7
-class History implements \Countable
8
-{
7
+class History implements \Countable
8
+{
9 9
     /**
10 10
      * @var \DesignPattern\Behavioral\Memento\Memento[]
11 11
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * History constructor.
16 16
      */
17
-    public function __construct()
18
-    {
17
+    public function __construct()
18
+    {
19 19
         $this->mementos = [];
20 20
     }
21 21
 
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
      *
35 35
      * @return \DesignPattern\Behavioral\Memento\Memento|mixed|null
36 36
      */
37
-    public function popMemento()
38
-    {
39
-        if ($this->count() > 0) {
37
+    public function popMemento()
38
+    {
39
+        if ($this->count() > 0) {
40 40
             return array_pop($this->mementos);
41 41
         }
42 42
 
Please login to merge, or discard this patch.
src/Behavioral/Memento/State.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      */
65 65
     private static function isValidState(int $state): void
66 66
     {
67
-        if (! in_array($state, self::$validStates, true)) {
67
+        if ( ! in_array($state, self::$validStates, true)) {
68 68
             throw new \InvalidArgumentException('Invalid state given.');
69 69
         }
70 70
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Memento;
6 6
 
7
-class State
8
-{
7
+class State
8
+{
9 9
     public const STATUS_LOCKED = 1;
10 10
     public const STATUS_CONFIRMED = 2;
11 11
     public const STATUS_PAID = 3;
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @throws \Exception|\InvalidArgumentException
47 47
      */
48
-    public function __construct($state = self::STATUS_LOCKED)
49
-    {
48
+    public function __construct($state = self::STATUS_LOCKED)
49
+    {
50 50
         self::isValidState($state);
51 51
 
52 52
         $this->state = $state;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     private static function isValidState(int $state): void
66 66
     {
67
-        if (! in_array($state, self::$validStates, true)) {
67
+        if (! in_array($state, self::$validStates, true)) {
68 68
             throw new \InvalidArgumentException('Invalid state given.');
69 69
         }
70 70
     }
Please login to merge, or discard this patch.
src/Behavioral/Strategy/ComparatorInterface.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Strategy;
6 6
 
7
-interface ComparatorInterface
8
-{
7
+interface ComparatorInterface
8
+{
9 9
     /**
10 10
      * Compare the two given values.
11 11
      *
Please login to merge, or discard this patch.