@@ -13,39 +13,39 @@ |
||
13 | 13 | |
14 | 14 | class Account |
15 | 15 | { |
16 | - /** |
|
17 | - * @var string |
|
18 | - */ |
|
19 | - private $code; |
|
16 | + /** |
|
17 | + * @var string |
|
18 | + */ |
|
19 | + private $code; |
|
20 | 20 | |
21 | - /** |
|
22 | - * @var string |
|
23 | - */ |
|
24 | - private $email; |
|
21 | + /** |
|
22 | + * @var string |
|
23 | + */ |
|
24 | + private $email; |
|
25 | 25 | |
26 | - /** |
|
27 | - * @param string $email |
|
28 | - * @param string $code |
|
29 | - */ |
|
30 | - public function __construct($email, $code = null) |
|
31 | - { |
|
32 | - $this->code = $code; |
|
33 | - $this->email = $email; |
|
34 | - } |
|
26 | + /** |
|
27 | + * @param string $email |
|
28 | + * @param string $code |
|
29 | + */ |
|
30 | + public function __construct($email, $code = null) |
|
31 | + { |
|
32 | + $this->code = $code; |
|
33 | + $this->email = $email; |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return string|null |
|
38 | - */ |
|
39 | - public function getCode() |
|
40 | - { |
|
41 | - return $this->code; |
|
42 | - } |
|
36 | + /** |
|
37 | + * @return string|null |
|
38 | + */ |
|
39 | + public function getCode() |
|
40 | + { |
|
41 | + return $this->code; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - public function getEmail() |
|
48 | - { |
|
49 | - return $this->email; |
|
50 | - } |
|
44 | + /** |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + public function getEmail() |
|
48 | + { |
|
49 | + return $this->email; |
|
50 | + } |
|
51 | 51 | } |
@@ -13,15 +13,15 @@ |
||
13 | 13 | |
14 | 14 | interface Repository |
15 | 15 | { |
16 | - /** |
|
17 | - * @param string $code |
|
18 | - * @return Account|null |
|
19 | - */ |
|
20 | - public function find($code); |
|
16 | + /** |
|
17 | + * @param string $code |
|
18 | + * @return Account|null |
|
19 | + */ |
|
20 | + public function find($code); |
|
21 | 21 | |
22 | - /** |
|
23 | - * @param Account $account |
|
24 | - * @return void |
|
25 | - */ |
|
26 | - public function save(Account $account); |
|
22 | + /** |
|
23 | + * @param Account $account |
|
24 | + * @return void |
|
25 | + */ |
|
26 | + public function save(Account $account); |
|
27 | 27 | } |
@@ -14,24 +14,24 @@ |
||
14 | 14 | |
15 | 15 | class MemoryRepository implements Repository |
16 | 16 | { |
17 | - private $accounts = []; |
|
18 | - public function __construct($accounts) |
|
19 | - { |
|
20 | - array_map([$this, 'save'], $accounts); |
|
21 | - } |
|
22 | - public function find($code) |
|
23 | - { |
|
24 | - return $this->accounts[$code]; |
|
25 | - } |
|
26 | - public function save(Account $account) |
|
27 | - { |
|
28 | - $this->accounts[$account->getCode()] = $account; |
|
29 | - } |
|
17 | + private $accounts = []; |
|
18 | + public function __construct($accounts) |
|
19 | + { |
|
20 | + array_map([$this, 'save'], $accounts); |
|
21 | + } |
|
22 | + public function find($code) |
|
23 | + { |
|
24 | + return $this->accounts[$code]; |
|
25 | + } |
|
26 | + public function save(Account $account) |
|
27 | + { |
|
28 | + $this->accounts[$account->getCode()] = $account; |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $repository = new MemoryRepository([ |
33 | - new Account('[email protected]', '99f104e8-2fa3-4a77-1664-5bac75fb668d'), |
|
34 | - new Account('[email protected]', '68b3c837-c7f4-1b54-2efa-1c5cc2945c3f'), |
|
33 | + new Account('[email protected]', '99f104e8-2fa3-4a77-1664-5bac75fb668d'), |
|
34 | + new Account('[email protected]', '68b3c837-c7f4-1b54-2efa-1c5cc2945c3f'), |
|
35 | 35 | ]); |
36 | 36 | $logguedAccount = new Account('[email protected]', '7f75e972-d5c7-b0c5-1a1b-9d5a582cbd27'); |
37 | 37 |
@@ -103,7 +103,7 @@ |
||
103 | 103 | $result = rtrim($result, "\0"); |
104 | 104 | |
105 | 105 | $decodedJson = json_decode($result, true); |
106 | - $result = null!==$decodedJson ? $decodedJson : $result; |
|
106 | + $result = null !== $decodedJson ? $decodedJson : $result; |
|
107 | 107 | |
108 | 108 | $this->logger->debug('Uncrypting message', [$message, $result]); |
109 | 109 |