@@ -23,10 +23,10 @@ |
||
| 23 | 23 | $this->authGateway = $authGateway; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public function execute():?string |
|
| 26 | + public function execute(): ?string |
|
| 27 | 27 | { |
| 28 | 28 | $currentUser = $this->authGateway->current(); |
| 29 | - if(!isset($currentUser)){ |
|
| 29 | + if (!isset($currentUser)) { |
|
| 30 | 30 | return 'nothing_to_do'; |
| 31 | 31 | } |
| 32 | 32 | $anonymousUser = new AnonymousUser($this->authGateway->wikiSessionId()); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | $canInteractUser = $this->getInteractUser(); |
| 48 | 48 | $interaction = $this->interactionRepository->getByInteractUser($canInteractUser, $pageId); |
| 49 | - if(!isset($interaction)) { |
|
| 49 | + if (!isset($interaction)) { |
|
| 50 | 50 | $canInteractUser->addInteraction($interactions, $pageId); |
| 51 | 51 | return; |
| 52 | 52 | } |
@@ -30,8 +30,8 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function update(array $interactions) |
| 32 | 32 | { |
| 33 | - foreach ($interactions as $interaction){ |
|
| 34 | - switch ($interaction){ |
|
| 33 | + foreach ($interactions as $interaction) { |
|
| 34 | + switch ($interaction) { |
|
| 35 | 35 | case 'follow': |
| 36 | 36 | $this->follow = true; |
| 37 | 37 | break; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | interface AuthGateway |
| 10 | 10 | { |
| 11 | - public function current():? User; |
|
| 11 | + public function current(): ? User; |
|
| 12 | 12 | public function log(User $u); |
| 13 | 13 | public function wikiSessionId():string; |
| 14 | 14 | } |
@@ -8,6 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | interface PageRepository |
| 10 | 10 | { |
| 11 | - public function get(string $pageId):?Page; |
|
| 11 | + public function get(string $pageId): ?Page; |
|
| 12 | 12 | public function save(Page $page); |
| 13 | 13 | } |
@@ -10,5 +10,5 @@ |
||
| 10 | 10 | interface InteractionRepository |
| 11 | 11 | { |
| 12 | 12 | public function save(CanInteract $canInteract, Interaction $interaction); |
| 13 | - public function getByInteractUser(CanInteract $canInteract, int $pageId):?Interaction; |
|
| 13 | + public function getByInteractUser(CanInteract $canInteract, int $pageId): ?Interaction; |
|
| 14 | 14 | } |