Test Failed
Push — master ( ef98d1...9f09c4 )
by Jinyun
02:13
created
src/Behavioral/State/Pay.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\State;
6 6
 
7
-class Pay extends AbstractState
8
-{
7
+class Pay extends AbstractState
8
+{
9 9
     /**
10 10
      * @param \DesignPattern\Behavioral\State\Order $order
11 11
      *
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @throws \LogicException
25 25
      */
26
-    public function toDispatch(Order $order)
27
-    {
26
+    public function toDispatch(Order $order)
27
+    {
28 28
         throw new \LogicException('The order has to be paid before processing dispatch.');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
src/Behavioral/State/AbstractState.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\State;
6 6
 
7
-abstract class AbstractState implements StateInterface
8
-{
7
+abstract class AbstractState implements StateInterface
8
+{
9 9
     /**
10 10
      * To cancel order.
11 11
      *
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      *
14 14
      * @return mixed
15 15
      */
16
-    public function toCancel(Order $order)
17
-    {
16
+    public function toCancel(Order $order)
17
+    {
18 18
         $order->setState(new Cancel());
19 19
 
20 20
         return true;
Please login to merge, or discard this patch.
src/Behavioral/State/Dispatch.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\State;
6 6
 
7
-class Dispatch extends AbstractState
8
-{
7
+class Dispatch extends AbstractState
8
+{
9 9
     /**
10 10
      * To pay.
11 11
      *
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      *
14 14
      * @throws \LogicException
15 15
      */
16
-    public function toPay(Order $order)
17
-    {
16
+    public function toPay(Order $order)
17
+    {
18 18
         throw new \LogicException('Already paid.');
19 19
     }
20 20
 
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @throws \LogicException
27 27
      */
28
-    public function toDispatch(Order $order)
29
-    {
28
+    public function toDispatch(Order $order)
29
+    {
30 30
         throw new \LogicException('Already dispatched.');
31 31
     }
32 32
 }
Please login to merge, or discard this patch.
src/Behavioral/State/Cancel.php 1 patch
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\State;
6 6
 
7
-class Cancel extends AbstractState
8
-{
7
+class Cancel extends AbstractState
8
+{
9 9
     public const ORDER_CANCEL = 1;
10 10
     public const ORDER_PAY = 2;
11 11
     public const ORDER_DISPATCH = 3;
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
      *
16 16
      * @throws \LogicException
17 17
      */
18
-    public function toCancel(Order $order)
19
-    {
18
+    public function toCancel(Order $order)
19
+    {
20 20
         throw new \LogicException('Already cancelled.', self::ORDER_CANCEL);
21 21
     }
22 22
 
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @throws \LogicException
27 27
      */
28
-    public function toPay(Order $order)
29
-    {
28
+    public function toPay(Order $order)
29
+    {
30 30
         throw new \LogicException('Order cancelled.', self::ORDER_PAY);
31 31
     }
32 32
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
      *
36 36
      * @throws \LogicException
37 37
      */
38
-    public function toDispatch(Order $order)
39
-    {
38
+    public function toDispatch(Order $order)
39
+    {
40 40
         throw new \LogicException('Order cancelled.', self::ORDER_DISPATCH);
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
src/Behavioral/State/StateInterface.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\State;
6 6
 
7
-interface StateInterface
8
-{
7
+interface StateInterface
8
+{
9 9
     /**
10 10
      * Order cancel.
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Visitor/User.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Visitor;
6 6
 
7
-class User implements RoleInterface
8
-{
7
+class User implements RoleInterface
8
+{
9 9
     /**
10 10
      * @var string
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @param string $name
18 18
      */
19
-    public function __construct(string $name)
20
-    {
19
+    public function __construct(string $name)
20
+    {
21 21
         $this->name = $name;
22 22
     }
23 23
 
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
      *
37 37
      * @return mixed|void
38 38
      */
39
-    public function allow(VisitorInterface $visitor)
40
-    {
39
+    public function allow(VisitorInterface $visitor)
40
+    {
41 41
         $visitor->visitUser($this);
42 42
     }
43 43
 }
Please login to merge, or discard this patch.
src/Behavioral/Visitor/VisitorInterface.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\Visitor;
6 6
 
7
-interface VisitorInterface
8
-{
7
+interface VisitorInterface
8
+{
9 9
     /**
10 10
      * @param \DesignPattern\Behavioral\Visitor\User $user
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Visitor/RoleVisitor.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Visitor;
6 6
 
7
-class RoleVisitor implements VisitorInterface
8
-{
7
+class RoleVisitor implements VisitorInterface
8
+{
9 9
     /**
10 10
      * @var \DesignPattern\Behavioral\Visitor\RoleInterface[]
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @return mixed|void
18 18
      */
19
-    public function visitUser(User $user)
20
-    {
19
+    public function visitUser(User $user)
20
+    {
21 21
         $this->roles[] = $user;
22 22
     }
23 23
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @return mixed|void
28 28
      */
29
-    public function visitGroup(Group $group)
30
-    {
29
+    public function visitGroup(Group $group)
30
+    {
31 31
         $this->roles[] = $group;
32 32
     }
33 33
 
Please login to merge, or discard this patch.
src/Behavioral/Visitor/Group.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Visitor;
6 6
 
7
-class Group implements RoleInterface
8
-{
7
+class Group implements RoleInterface
8
+{
9 9
     /**
10 10
      * @var string
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @param string $name
18 18
      */
19
-    public function __construct(string $name)
20
-    {
19
+    public function __construct(string $name)
20
+    {
21 21
         $this->name = $name;
22 22
     }
23 23
 
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
      *
37 37
      * @return mixed|void
38 38
      */
39
-    public function allow(VisitorInterface $visitor)
40
-    {
39
+    public function allow(VisitorInterface $visitor)
40
+    {
41 41
         $visitor->visitGroup($this);
42 42
     }
43 43
 }
Please login to merge, or discard this patch.