Test Failed
Push — master ( ef98d1...9f09c4 )
by Jinyun
02:13
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/User.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\More\Repository;
6 6
 
7
-class User
8
-{
7
+class User
8
+{
9 9
     /**
10 10
      * @var int|null
11 11
      */
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
      * @param string $username
29 29
      * @param string $email
30 30
      */
31
-    public function __construct(int $id, string $username, string $email)
32
-    {
31
+    public function __construct(int $id, string $username, string $email)
32
+    {
33 33
         $this->id = $id;
34 34
         $this->username = $username;
35 35
         $this->email = $email;
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/Repository/UserRepository.php 1 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\More\Repository;
6 6
 
7
-class UserRepository implements RepositoryInterface
8
-{
7
+class UserRepository implements RepositoryInterface
8
+{
9 9
     /**
10 10
      * @var \DesignPattern\More\Repository\MemoryStorage
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @param \DesignPattern\More\Repository\MemoryStorage $storage
18 18
      */
19
-    public function __construct(MemoryStorage $storage)
20
-    {
19
+    public function __construct(MemoryStorage $storage)
20
+    {
21 21
         $this->storage = $storage;
22 22
     }
23 23
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $array = $this->storage->read($id);
36 36
 
37
-        if ($array === null) {
37
+        if ($array === null) {
38 38
             $message = sprintf('User with ID #%d does not exist.', $id);
39 39
             throw new \InvalidArgumentException($message);
40 40
         }
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/EntityAttributeValue/Value.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\More\EntityAttributeValue;
6 6
 
7
-class Value
8
-{
7
+class Value
8
+{
9 9
     /**
10 10
      * @var \DesignPattern\More\EntityAttributeValue\Attribute
11 11
      */
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
      * @param \DesignPattern\More\EntityAttributeValue\Attribute $attribute
23 23
      * @param string $name
24 24
      */
25
-    public function __construct(Attribute $attribute, string $name)
26
-    {
25
+    public function __construct(Attribute $attribute, string $name)
26
+    {
27 27
         $this->attribute = $attribute;
28 28
         $this->name = $name;
29 29
 
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
     /**
34 34
      * @return string
35 35
      */
36
-    public function __toString()
37
-    {
36
+    public function __toString()
37
+    {
38 38
         return sprintf('%s: %s', $this->attribute, $this->name);
39 39
     }
40 40
 }
Please login to merge, or discard this patch.