@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function save(User $user = null) |
54 | 54 | { |
55 | - if($user === null){ |
|
55 | + if ($user === null) { |
|
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function update(User $userToUpdate, User $user) |
66 | 66 | { |
67 | - foreach ($this->users as $key => $row){ |
|
68 | - if($row->getUserName() === $user->getUserName()){ |
|
67 | + foreach ($this->users as $key => $row) { |
|
68 | + if ($row->getUserName() === $user->getUserName()) { |
|
69 | 69 | $this->users[$key] = $user; |
70 | 70 | break; |
71 | 71 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function delete(User $user) |
79 | 79 | { |
80 | - foreach ($this->users as $key => $row){ |
|
81 | - if($row->getUserName() === $user->getUserName()){ |
|
80 | + foreach ($this->users as $key => $row) { |
|
81 | + if ($row->getUserName() === $user->getUserName()) { |
|
82 | 82 | unset($this->users[$key]); |
83 | 83 | break; |
84 | 84 | } |
@@ -44,6 +44,6 @@ |
||
44 | 44 | |
45 | 45 | $handler->handle($command); |
46 | 46 | |
47 | - $output->writeln($username . ' has been deleted'); |
|
47 | + $output->writeln($username.' has been deleted'); |
|
48 | 48 | } |
49 | 49 | } |
@@ -15,14 +15,14 @@ |
||
15 | 15 | * DeleteUserHandler constructor. |
16 | 16 | * @param UserRepository $userRepository |
17 | 17 | */ |
18 | - public function __construct(UserRepository $userRepository){ |
|
18 | + public function __construct(UserRepository $userRepository) { |
|
19 | 19 | $this->userRepository = $userRepository; |
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @param DeleteUser $command |
24 | 24 | */ |
25 | - public function handle(DeleteUser $command){ |
|
25 | + public function handle(DeleteUser $command) { |
|
26 | 26 | $this->userRepository->delete($command->user); |
27 | 27 | } |
28 | 28 | } |
@@ -16,14 +16,14 @@ |
||
16 | 16 | * CreateUserHandler constructor. |
17 | 17 | * @param UserRepository $userRepository |
18 | 18 | */ |
19 | - public function __construct(UserRepository $userRepository){ |
|
19 | + public function __construct(UserRepository $userRepository) { |
|
20 | 20 | $this->userRepository = $userRepository; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @param UpdateUser $command |
25 | 25 | */ |
26 | - public function handle(UpdateUser $command){ |
|
26 | + public function handle(UpdateUser $command) { |
|
27 | 27 | $updatingUser = $command->user; |
28 | 28 | $user = new User($command->username, $command->password, $command->displayName); |
29 | 29 | $this->userRepository->update($updatingUser, $user); |
@@ -52,6 +52,6 @@ |
||
52 | 52 | |
53 | 53 | $handler->handle($command); |
54 | 54 | |
55 | - $output->writeln($username . ' has been created'); |
|
55 | + $output->writeln($username.' has been created'); |
|
56 | 56 | } |
57 | 57 | } |
@@ -17,14 +17,14 @@ |
||
17 | 17 | * CreateUserHandler constructor. |
18 | 18 | * @param UserRepository $userRepository |
19 | 19 | */ |
20 | - public function __construct(UserRepository $userRepository){ |
|
20 | + public function __construct(UserRepository $userRepository) { |
|
21 | 21 | $this->userRepository = $userRepository; |
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @param CreateUser $command |
26 | 26 | */ |
27 | - public function handle(CreateUser $command){ |
|
27 | + public function handle(CreateUser $command) { |
|
28 | 28 | $user = new User($command->username, $command->password, $command->displayName); |
29 | 29 | $this->userRepository->add($user); |
30 | 30 | } |