Completed
Push — master ( 7ef11c...023db7 )
by Jinyun
09:48 queued 05:48
created
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.
src/Structural/Proxy/WifiNetworkInterface.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\Structural\Proxy;
4 4
 
5
-interface WifiNetworkInterface
6
-{
5
+interface WifiNetworkInterface
6
+{
7 7
     /**
8 8
      * Grant access to the Wifi network to an employee.
9 9
      *
Please login to merge, or discard this patch.
src/Structural/Proxy/WifiNetworkProxy.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Structural\Proxy;
4 4
 
5
-class WifiNetworkProxy implements WifiNetworkInterface
6
-{
5
+class WifiNetworkProxy implements WifiNetworkInterface
6
+{
7 7
     /**
8 8
      * @var \DesignPattern\Structural\Proxy\WifiNetwork
9 9
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param string $name
16 16
      */
17
-    public function __construct(string $name)
18
-    {
17
+    public function __construct(string $name)
18
+    {
19 19
         $this->wifiNetwork = new WifiNetwork($name);
20 20
     }
21 21
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function grantAccess(Employee $employee): bool
30 30
     {
31
-        if ($employee->getAccessLevel() === Employee::ACCESS_LEVEL_ALLOW) {
31
+        if ($employee->getAccessLevel() === Employee::ACCESS_LEVEL_ALLOW) {
32 32
             return $this->wifiNetwork->grantAccess($employee);
33 33
         }
34 34
 
Please login to merge, or discard this patch.
src/Structural/Proxy/Employee.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Structural\Proxy;
4 4
 
5
-class Employee
6
-{
5
+class Employee
6
+{
7 7
     /**
8 8
      * No access to WiFi.
9 9
      */
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         string $username,
41 41
         string $password,
42 42
         int $accessLevel
43
-    ) {
43
+    ) {
44 44
         $this->username = $username;
45 45
         $this->password = $password;
46 46
         $this->accessLevel = $accessLevel;
Please login to merge, or discard this patch.
src/Structural/Proxy/WifiNetwork.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Structural\Proxy;
4 4
 
5
-class WifiNetwork implements WifiNetworkInterface
6
-{
5
+class WifiNetwork implements WifiNetworkInterface
6
+{
7 7
     /**
8 8
      * @var string
9 9
      */
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param string $name
16 16
      */
17
-    public function __construct(string $name)
18
-    {
17
+    public function __construct(string $name)
18
+    {
19 19
         $this->name = $name;
20 20
     }
21 21
 
Please login to merge, or discard this patch.
src/Structural/Facade/MacOSInterface.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\Structural\Facade;
4 4
 
5
-interface MacOSInterface
6
-{
5
+interface MacOSInterface
6
+{
7 7
     public function restart();
8 8
 
9 9
     public function shutdown();
Please login to merge, or discard this patch.
src/Structural/Facade/Facade.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace DesignPattern\Structural\Facade;
4 4
 
5
-class Facade
6
-{
5
+class Facade
6
+{
7 7
     /**
8 8
      * @var \DesignPattern\Structural\Facade\BiosInterface
9 9
      */
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
      * @param \DesignPattern\Structural\Facade\BiosInterface $bios
21 21
      * @param \DesignPattern\Structural\Facade\MacOSInterface $macOS
22 22
      */
23
-    public function __construct(BiosInterface $bios, MacOSInterface $macOS)
24
-    {
23
+    public function __construct(BiosInterface $bios, MacOSInterface $macOS)
24
+    {
25 25
         $this->bios = $bios;
26 26
         $this->macOS = $macOS;
27 27
     }
Please login to merge, or discard this patch.
src/Structural/Facade/MacOS.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  *
8 8
  * @package DesignPattern\Structural\Facade
9 9
  */
10
-class MacOS implements MacOSInterface
11
-{
10
+class MacOS implements MacOSInterface
11
+{
12 12
     /**
13 13
      * @var string
14 14
      */
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
      *
48 48
      * @return mixed
49 49
      */
50
-    protected function execute($command)
51
-    {
52
-        if (in_array($command, ['restart', 'shutdown'], true)) {
50
+    protected function execute($command)
51
+    {
52
+        if (in_array($command, ['restart', 'shutdown'], true)) {
53 53
             return sprintf('The system is executing the %s command...', $command);
54 54
         }
55 55
 
Please login to merge, or discard this patch.