Completed
Push — master ( 7ef11c...023db7 )
by Jinyun
09:48 queued 05:48
created
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.
src/Behavioral/Visitor/RoleInterface.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 RoleInterface
8
-{
7
+interface RoleInterface
8
+{
9 9
     /**
10 10
      * @param \DesignPattern\Behavioral\Visitor\VisitorInterface $visitor
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Mediator/AbstractColleague.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Mediator;
4 4
 
5
-abstract class AbstractColleague
6
-{
5
+abstract class AbstractColleague
6
+{
7 7
     /**
8 8
      * @var \DesignPattern\Behavioral\Mediator\MediatorInterface
9 9
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param \DesignPattern\Behavioral\Mediator\MediatorInterface $mediator
16 16
      */
17
-    public function __construct(MediatorInterface $mediator)
18
-    {
17
+    public function __construct(MediatorInterface $mediator)
18
+    {
19 19
         $this->mediator = $mediator;
20 20
     }
21 21
 
Please login to merge, or discard this patch.
src/Behavioral/Mediator/MediatorInterface.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Mediator;
4 4
 
5
-interface MediatorInterface
6
-{
5
+interface MediatorInterface
6
+{
7 7
     public function sendRequest();
8 8
 
9 9
     public function query();
Please login to merge, or discard this patch.
src/Behavioral/Mediator/Consumer.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Mediator;
4 4
 
5
-class Consumer extends AbstractColleague
6
-{
7
-    public function request()
8
-    {
5
+class Consumer extends AbstractColleague
6
+{
7
+    public function request()
8
+    {
9 9
         return $this->getMediator()->sendRequest();
10 10
     }
11 11
 
12
-    public function output($content)
13
-    {
12
+    public function output($content)
13
+    {
14 14
         return $content;
15 15
     }
16 16
 }
Please login to merge, or discard this patch.
src/Behavioral/Mediator/Mediator.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Mediator;
4 4
 
5
-class Mediator implements MediatorInterface
6
-{
5
+class Mediator implements MediatorInterface
6
+{
7 7
     /**
8 8
      * @var \DesignPattern\Behavioral\Mediator\Consumer
9 9
      */
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return mixed
68 68
      */
69
-    public function sendRequest()
70
-    {
69
+    public function sendRequest()
70
+    {
71 71
         return $this->server->response();
72 72
     }
73 73
 
Please login to merge, or discard this patch.
src/Behavioral/Mediator/Server.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Mediator;
4 4
 
5
-class Server extends AbstractColleague
6
-{
7
-    public function response()
8
-    {
5
+class Server extends AbstractColleague
6
+{
7
+    public function response()
8
+    {
9 9
         $data = $this->getMediator()->query();
10 10
 
11 11
         return $this->getMediator()->recvResponse(sprintf('Hello %s', $data));
Please login to merge, or discard this patch.
src/Behavioral/Mediator/Database.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Mediator;
4 4
 
5
-class Database extends AbstractColleague
6
-{
5
+class Database extends AbstractColleague
6
+{
7 7
     /**
8 8
      * Query some data.
9 9
      *
Please login to merge, or discard this patch.
src/Behavioral/ChainOfResponsibility/MemoryHandler.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
 use Psr\Http\Message\RequestInterface;
6 6
 
7
-class MemoryHandler extends Handler
8
-{
7
+class MemoryHandler extends Handler
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
      * @param array $data
18 18
      * @param \DesignPattern\Behavioral\ChainOfResponsibility\Handler|null $handler
19 19
      */
20
-    public function __construct(array $data, Handler $handler = null)
21
-    {
20
+    public function __construct(array $data, Handler $handler = null)
21
+    {
22 22
         parent::__construct($handler);
23 23
 
24 24
         $this->data = $data;
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @return mixed|null
33 33
      */
34
-    protected function process(RequestInterface $request)
35
-    {
34
+    protected function process(RequestInterface $request)
35
+    {
36 36
         $key = sprintf(
37 37
             '%s?%s',
38 38
             $request->getUri()->getPath(),
39 39
             $request->getUri()->getQuery()
40 40
         );
41 41
 
42
-        if (isset($this->data[$key]) && $request->getMethod() === 'GET') {
42
+        if (isset($this->data[$key]) && $request->getMethod() === 'GET') {
43 43
             return $this->data[$key];
44 44
         }
45 45
 
Please login to merge, or discard this patch.