Completed
Push — master ( f02d13...354f1a )
by Jinyun
02:08
created
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/Bios.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 Bios implements BiosInterface
6
-{
5
+class Bios implements BiosInterface
6
+{
7 7
     /**
8 8
      * @return string
9 9
      */
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
      *
18 18
      * @return mixed
19 19
      */
20
-    public function launch(MacOSInterface $macOS)
21
-    {
20
+    public function launch(MacOSInterface $macOS)
21
+    {
22 22
         return $macOS->launch();
23 23
     }
24 24
 
Please login to merge, or discard this patch.
src/Structural/Facade/BiosInterface.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 BiosInterface
6
-{
5
+interface BiosInterface
6
+{
7 7
     public function execute();
8 8
 
9 9
     /**
Please login to merge, or discard this patch.