Test Failed
Push — master ( e14434...8898dc )
by Jinyun
10:43 queued 46s
created
src/More/Repository/RepositoryInterface.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\More\Repository;
6 6
 
7
-interface RepositoryInterface
8
-{
7
+interface RepositoryInterface
8
+{
9 9
     public function find(int $id);
10 10
 
11 11
     public function save(User $user);
Please login to merge, or discard this patch.
src/More/Repository/MemoryStorage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
      */
73 73
     private function validate(int $id): void
74 74
     {
75
-        if (! isset($this->data[$id])) {
75
+        if ( ! isset($this->data[$id])) {
76 76
             throw new \OutOfRangeException(
77 77
                 sprintf(
78 78
                     'Data for ID #%d is not found.',
Please login to merge, or discard this 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\More\Repository;
6 6
 
7
-class MemoryStorage
8
-{
7
+class MemoryStorage
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     private function validate(int $id): void
74 74
     {
75
-        if (! isset($this->data[$id])) {
75
+        if (! isset($this->data[$id])) {
76 76
             throw new \OutOfRangeException(
77 77
                 sprintf(
78 78
                     'Data for ID #%d is not found.',
Please login to merge, or discard this patch.
src/More/ServiceLocator/ServiceInterface.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\More\ServiceLocator;
6 6
 
7
-interface ServiceInterface
8
-{
7
+interface ServiceInterface
8
+{
9 9
 }
Please login to merge, or discard this patch.
src/More/ServiceLocator/ServiceLocator.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
 namespace DesignPattern\More\ServiceLocator;
6 6
 
7
-class ServiceLocator
8
-{
7
+class ServiceLocator
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
      *
79 79
      * @throws \OutOfRangeException
80 80
      */
81
-    public function get(string $class)
82
-    {
83
-        if (isset($this->instantiated[$class]) && $this->shared[$class]) {
81
+    public function get(string $class)
82
+    {
83
+        if (isset($this->instantiated[$class]) && $this->shared[$class]) {
84 84
             return $this->instantiated[$class];
85 85
         }
86 86
 
87 87
         $object = $this->getInstance($class);
88 88
 
89
-        if ($this->shared[$class]) {
89
+        if ($this->shared[$class]) {
90 90
             $this->instantiated[$class] = $object;
91 91
         }
92 92
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     private function getInstance(string $class): ServiceInterface
106 106
     {
107 107
         $args = $this->services[$class];
108
-        switch (\count($args)) {
108
+        switch (\count($args)) {
109 109
             case 0:
110 110
                 $object = new $class();
111 111
                 break;
Please login to merge, or discard this patch.
src/More/ServiceLocator/ResponseService.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\More\ServiceLocator;
6 6
 
7
-class ResponseService implements ServiceInterface
8
-{
7
+class ResponseService implements ServiceInterface
8
+{
9 9
 }
Please login to merge, or discard this patch.
src/More/ServiceLocator/RequestService.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\More\ServiceLocator;
6 6
 
7
-class RequestService implements ServiceInterface
8
-{
7
+class RequestService implements ServiceInterface
8
+{
9 9
 }
Please login to merge, or discard this patch.
src/More/Delegation/Component.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\More\Delegation;
6 6
 
7
-class Component
8
-{
7
+class Component
8
+{
9 9
     /**
10 10
      * String to array.
11 11
      *
Please login to merge, or discard this patch.
src/Creational/SimpleFactory/Swift.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\Creational\SimpleFactory;
6 6
 
7
-class Swift implements LanguageInterface
8
-{
7
+class Swift implements LanguageInterface
8
+{
9 9
     /**
10 10
      * Swift language write application.
11 11
      *
Please login to merge, or discard this patch.
src/Creational/SimpleFactory/SimpleFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function create(string $language): LanguageInterface
35 35
     {
36
-        if (! array_key_exists($language, $this->language)) {
36
+        if ( ! array_key_exists($language, $this->language)) {
37 37
             throw new \InvalidArgumentException("$language is not valid programming language.");
38 38
         }
39 39
         $class = $this->language[$language];
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\Creational\SimpleFactory;
6 6
 
7
-class SimpleFactory
8
-{
7
+class SimpleFactory
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * SimpleFactory constructor.
16 16
      */
17
-    public function __construct()
18
-    {
17
+    public function __construct()
18
+    {
19 19
         $this->language = [
20 20
             'java' => __NAMESPACE__ . '\\Java',
21 21
             'swift' => __NAMESPACE__ . '\\Swift',
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function create(string $language): LanguageInterface
35 35
     {
36
-        if (! array_key_exists($language, $this->language)) {
36
+        if (! array_key_exists($language, $this->language)) {
37 37
             throw new \InvalidArgumentException("$language is not valid programming language.");
38 38
         }
39 39
         $class = $this->language[$language];
Please login to merge, or discard this patch.