Test Failed
Push — master ( dd1603...e14434 )
by Jinyun
06:30
created
src/Behavioral/Command/Computer.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\Command;
4 4
 
5
-class Computer
6
-{
5
+class Computer
6
+{
7 7
     /**
8 8
      * @return void
9 9
      */
Please login to merge, or discard this patch.
src/Behavioral/Command/CommandInterface.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Behavioral\Command;
4 4
 
5
-interface CommandInterface
6
-{
5
+interface CommandInterface
6
+{
7 7
     public function execute();
8 8
 }
Please login to merge, or discard this patch.
src/Behavioral/Specification/AbstractSpecification.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,6 +4,6 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\Specification;
6 6
 
7
-abstract class AbstractSpecification implements SpecificationInterface
8
-{
7
+abstract class AbstractSpecification implements SpecificationInterface
8
+{
9 9
 }
Please login to merge, or discard this patch.
src/Behavioral/Specification/LogicalSpecification.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\Specification;
6 6
 
7
-class LogicalSpecification extends AbstractSpecification
8
-{
7
+class LogicalSpecification extends AbstractSpecification
8
+{
9 9
     /**
10 10
      * @var string
11 11
      */
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function __construct(
26 26
         string $type,
27 27
         SpecificationInterface ...$specification
28
-    ) {
28
+    ) {
29 29
         $this->type = strtolower(trim($type));
30 30
         self::checkType($this->type);
31 31
         $this->specifications = $specification;
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $type = $this->type;
44 44
 
45
-        if ($type === 'not') {
45
+        if ($type === 'not') {
46 46
             return ! $this->specifications[0]->isSatisfiedBy($item);
47 47
         }
48 48
 
49 49
         $flag = $type === 'and';
50
-        foreach ($this->specifications as $specification) {
51
-            if ($flag && ! $specification->isSatisfiedBy($item)) {
50
+        foreach ($this->specifications as $specification) {
51
+            if ($flag && ! $specification->isSatisfiedBy($item)) {
52 52
                 return false;
53 53
             }
54 54
 
55
-            if (! $flag && $specification->isSatisfiedBy($item)) {
55
+            if (! $flag && $specification->isSatisfiedBy($item)) {
56 56
                 return true;
57 57
             }
58 58
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     private static function checkType(string $type): void
71 71
     {
72
-        if (! \in_array($type, ['not', 'and', 'or'], true)) {
72
+        if (! \in_array($type, ['not', 'and', 'or'], true)) {
73 73
             throw new \InvalidArgumentException('Logical type parameter error.');
74 74
         }
75 75
     }
Please login to merge, or discard this patch.
src/Behavioral/NullObject/NullLogger.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 
5 5
 namespace DesignPattern\Behavioral\NullObject;
6 6
 
7
-class NullLogger implements LoggerInterface
8
-{
9
-    public function log(string $string)
10
-    {
7
+class NullLogger implements LoggerInterface
8
+{
9
+    public function log(string $string)
10
+    {
11 11
     }
12 12
 }
Please login to merge, or discard this patch.
src/Behavioral/NullObject/LoggerInterface.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\NullObject;
6 6
 
7
-interface LoggerInterface
8
-{
7
+interface LoggerInterface
8
+{
9 9
     /**
10 10
      * Record log.
11 11
      *
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.