Completed
Push — master ( 19478b...7ef11c )
by Jinyun
10:33 queued 08:12
created
src/Structural/DataMapper/UserMapper.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\Structural\DataMapper;
6 6
 
7
-class UserMapper
8
-{
7
+class UserMapper
8
+{
9 9
     /**
10 10
      * @var \DesignPattern\Structural\DataMapper\Repository
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @param \DesignPattern\Structural\DataMapper\Repository $repository
18 18
      */
19
-    public function __construct(Repository $repository)
20
-    {
19
+    public function __construct(Repository $repository)
20
+    {
21 21
         $this->repository = $repository;
22 22
     }
23 23
 
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
      * @return mixed
30 30
      * @throws \InvalidArgumentException
31 31
      */
32
-    public function findById(int $id)
33
-    {
32
+    public function findById(int $id)
33
+    {
34 34
         $result = $this->repository->find($id);
35 35
 
36
-        if ($result === null) {
36
+        if ($result === null) {
37 37
             throw new \InvalidArgumentException("User #$id not found.", $id);
38 38
         }
39 39
 
Please login to merge, or discard this patch.
src/Structural/DataMapper/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\Structural\DataMapper;
6 6
 
7
-class User
8
-{
7
+class User
8
+{
9 9
     /**
10 10
      * @var string
11 11
      */
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
      * @param string $username
23 23
      * @param string $email
24 24
      */
25
-    public function __construct(string $username, string $email)
26
-    {
25
+    public function __construct(string $username, string $email)
26
+    {
27 27
         $this->username = $username;
28 28
         $this->email = $email;
29 29
     }
Please login to merge, or discard this patch.
src/Structural/DataMapper/Repository.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\Structural\DataMapper;
6 6
 
7
-class Repository
8
-{
7
+class Repository
8
+{
9 9
     /**
10 10
      * @var array
11 11
      */
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      *
17 17
      * @param array $data
18 18
      */
19
-    public function __construct(array $data)
20
-    {
19
+    public function __construct(array $data)
20
+    {
21 21
         $this->data = $data;
22 22
     }
23 23
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @return mixed|null
30 30
      */
31
-    public function find(int $id)
32
-    {
31
+    public function find(int $id)
32
+    {
33 33
         return $this->data[$id] ?? null;
34 34
     }
35 35
 }
Please login to merge, or discard this patch.