Test Failed
Branch master (d02fed)
by Jinyun
07:13
created
src/Behavioral/Strategy/Collection.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public function sort(): array
36 36
     {
37
-        if (! $this->comparator) {
37
+        if ( ! $this->comparator) {
38 38
             throw new \LogicException('Comparator is not set.');
39 39
         }
40 40
 
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\Strategy;
6 6
 
7
-class Collection
8
-{
7
+class Collection
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @param  array  $elements
23 23
      */
24
-    public function __construct(array $elements = [])
25
-    {
24
+    public function __construct(array $elements = [])
25
+    {
26 26
         $this->elements = $elements;
27 27
     }
28 28
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function sort(): array
36 36
     {
37
-        if (! $this->comparator) {
37
+        if (! $this->comparator) {
38 38
             throw new \LogicException('Comparator is not set.');
39 39
         }
40 40
 
Please login to merge, or discard this patch.
src/Behavioral/Strategy/DateComparator.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
-class DateComparator implements ComparatorInterface
8
-{
7
+class DateComparator implements ComparatorInterface
8
+{
9 9
     /**
10 10
      * Compare the two given date values.
11 11
      *
Please login to merge, or discard this patch.
src/Behavioral/Iterator/ItemList.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     public function addItem(Item $item): void
48 48
     {
49
-        if (! in_array($item, $this->list, true)) {
49
+        if ( ! in_array($item, $this->list, true)) {
50 50
             $this->list[] = $item;
51 51
         }
52 52
     }
Please login to merge, or discard this 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\Iterator;
4 4
 
5
-class ItemList implements \Countable
6
-{
5
+class ItemList implements \Countable
6
+{
7 7
     /**
8 8
      * @var array|\DesignPattern\Behavioral\Iterator\Item[]
9 9
      */
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
     /**
13 13
      * ItemList constructor.
14 14
      */
15
-    public function __construct()
16
-    {
15
+    public function __construct()
16
+    {
17 17
         $this->list = [];
18 18
     }
19 19
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function getItem(int $id): ?Item
36 36
     {
37
-        if ($id < $this->count()) {
37
+        if ($id < $this->count()) {
38 38
             return $this->list[$id];
39 39
         }
40 40
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function addItem(Item $item): void
48 48
     {
49
-        if (! in_array($item, $this->list, true)) {
49
+        if (! in_array($item, $this->list, true)) {
50 50
             $this->list[] = $item;
51 51
         }
52 52
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $id = array_search($item, $this->list, true);
60 60
 
61
-        if ($id !== false) {
61
+        if ($id !== false) {
62 62
             unset($this->list[$id]);
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
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 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
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.
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.