Completed
Push — master ( 7ef11c...023db7 )
by Jinyun
09:48 queued 05:48
created
src/Behavioral/NullObject/Service.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\NullObject;
6 6
 
7
-class Service
8
-{
7
+class Service
8
+{
9 9
     /**
10 10
      * @var \DesignPattern\Behavioral\NullObject\LoggerInterface
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @param \DesignPattern\Behavioral\NullObject\LoggerInterface $logger
18 18
      */
19
-    public function __construct(LoggerInterface $logger)
20
-    {
19
+    public function __construct(LoggerInterface $logger)
20
+    {
21 21
         $this->logger = $logger;
22 22
     }
23 23
 
Please login to merge, or discard this patch.
src/Behavioral/NullObject/PrintLogger.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\NullObject;
6 6
 
7
-class PrintLogger implements LoggerInterface
8
-{
9
-    public function log(string $string)
10
-    {
7
+class PrintLogger implements LoggerInterface
8
+{
9
+    public function log(string $string)
10
+    {
11 11
         echo $string;
12 12
     }
13 13
 }
Please login to merge, or discard this patch.
src/Behavioral/TemplateMethod/JsonTemplate.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\TemplateMethod;
6 6
 
7
-class JsonTemplate extends AbstractTemplate
8
-{
7
+class JsonTemplate extends AbstractTemplate
8
+{
9 9
     /**
10 10
      * @return string
11 11
      */
Please login to merge, or discard this patch.
src/Behavioral/TemplateMethod/AbstractTemplate.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\TemplateMethod;
6 6
 
7
-abstract class AbstractTemplate
8
-{
7
+abstract class AbstractTemplate
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $this->toDoThings[] = $this->toExecute();
24 24
 
25 25
         $helper = $this->getHelper();
26
-        if ($helper !== null) {
26
+        if ($helper !== null) {
27 27
             $this->toDoThings[] = $helper;
28 28
         }
29 29
 
Please login to merge, or discard this patch.
src/Behavioral/TemplateMethod/HtmlTemplate.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\TemplateMethod;
6 6
 
7
-class HtmlTemplate extends AbstractTemplate
8
-{
7
+class HtmlTemplate extends AbstractTemplate
8
+{
9 9
     /**
10 10
      * @return string
11 11
      */
Please login to merge, or discard this patch.
src/Behavioral/Interpreter/Variable.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Interpreter;
4 4
 
5
-class Variable implements ExpressionInterface
6
-{
5
+class Variable implements ExpressionInterface
6
+{
7 7
     /**
8 8
      * @var string
9 9
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param string $name
16 16
      */
17
-    public function __construct(string $name)
18
-    {
17
+    public function __construct(string $name)
18
+    {
19 19
         $this->name = $name;
20 20
     }
21 21
 
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @throws \InvalidArgumentException
28 28
      */
29
-    public function interpret(array $context)
30
-    {
31
-        if (isset($context[$this->name])) {
29
+    public function interpret(array $context)
30
+    {
31
+        if (isset($context[$this->name])) {
32 32
             return $context[$this->name]->interpret($context);
33 33
         }
34 34
 
Please login to merge, or discard this patch.
src/Behavioral/Interpreter/Operation.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Interpreter;
4 4
 
5
-class Operation implements ExpressionInterface
6
-{
5
+class Operation implements ExpressionInterface
6
+{
7 7
     /**
8 8
      * @var \DesignPattern\Behavioral\Interpreter\ExpressionInterface
9 9
      */
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         ExpressionInterface $left,
31 31
         ExpressionInterface $right,
32 32
         string $operator = ''
33
-    ) {
33
+    ) {
34 34
         $this->left = $left;
35 35
         $this->right = $right;
36 36
         $this->operator = $operator;
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return float|int|mixed|string
43 43
      */
44
-    public function interpret(array $context)
45
-    {
44
+    public function interpret(array $context)
45
+    {
46 46
         $left = $this->left->interpret($context);
47 47
         $right = $this->right->interpret($context);
48 48
 
49
-        switch ($this->operator) {
49
+        switch ($this->operator) {
50 50
             case '-':
51 51
                 return $left - $right;
52 52
             case '*':
Please login to merge, or discard this patch.
src/Behavioral/Interpreter/ExpressionInterface.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\Interpreter;
4 4
 
5
-interface ExpressionInterface
6
-{
5
+interface ExpressionInterface
6
+{
7 7
     /**
8 8
      * @param array $context
9 9
      *
Please login to merge, or discard this patch.
src/Behavioral/Interpreter/Number.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\Interpreter;
4 4
 
5
-class Number implements ExpressionInterface
6
-{
5
+class Number implements ExpressionInterface
6
+{
7 7
     /**
8 8
      * @var int
9 9
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param int $value
16 16
      */
17
-    public function __construct(int $value)
18
-    {
17
+    public function __construct(int $value)
18
+    {
19 19
         $this->value = $value;
20 20
     }
21 21
 
Please login to merge, or discard this patch.