@@ -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());  | 
                                                        
@@ -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 | }  | 
                                                        
@@ -48,7 +48,7 @@  | 
                                                    ||
| 48 | 48 | |
| 49 | 49 | $canInteractUser = $this->getInteractUser();  | 
                                                        
| 50 | 50 | $interaction = $this->interactionRepository->getByInteractUser($canInteractUser, $pageId);  | 
                                                        
| 51 | -        if(!isset($interaction)) { | 
                                                        |
| 51 | +        if (!isset($interaction)) { | 
                                                        |
| 52 | 52 | $canInteractUser->addInteraction($interactions, $pageId, $doneValue);  | 
                                                        
| 53 | 53 | return;  | 
                                                        
| 54 | 54 | }  | 
                                                        
@@ -33,8 +33,8 @@  | 
                                                    ||
| 33 | 33 | |
| 34 | 34 | public function update(array $interactions, array $doneValue = [])  | 
                                                        
| 35 | 35 |      { | 
                                                        
| 36 | -        foreach ($interactions as $interaction){ | 
                                                        |
| 37 | -            switch ($interaction){ | 
                                                        |
| 36 | +        foreach ($interactions as $interaction) { | 
                                                        |
| 37 | +            switch ($interaction) { | 
                                                        |
| 38 | 38 | case 'follow':  | 
                                                        
| 39 | 39 | $this->follow = true;  | 
                                                        
| 40 | 40 | break;  | 
                                                        
@@ -25,7 +25,7 @@  | 
                                                    ||
| 25 | 25 | $this->authGateway = $authGateway;  | 
                                                        
| 26 | 26 | }  | 
                                                        
| 27 | 27 | |
| 28 | - public function execute(int $pageId):?Interaction  | 
                                                        |
| 28 | + public function execute(int $pageId): ?Interaction  | 
                                                        |
| 29 | 29 |      { | 
                                                        
| 30 | 30 | $canInteractUser = $this->getInteractUser();  | 
                                                        
| 31 | 31 | return $this->interactionRepository->getByInteractUser($canInteractUser, $pageId);  | 
                                                        
@@ -13,7 +13,7 @@ discard block  | 
                                                    ||
| 13 | 13 | public function get(string $pageId): ?Page  | 
                                                        
| 14 | 14 |      { | 
                                                        
| 15 | 15 |          $pageModel = PageModel::where('page_id', $pageId)->first(); | 
                                                        
| 16 | -        if(!isset($pageModel)){ | 
                                                        |
| 16 | +        if (!isset($pageModel)) { | 
                                                        |
| 17 | 17 | return null;  | 
                                                        
| 18 | 18 | }  | 
                                                        
| 19 | 19 | return new Page($pageModel->page_id, $pageModel->dry);  | 
                                                        
@@ -22,7 +22,7 @@ discard block  | 
                                                    ||
| 22 | 22 | public function save(Page $page)  | 
                                                        
| 23 | 23 |      { | 
                                                        
| 24 | 24 |          $pageModel = PageModel::where('page_id', $page->pageId())->first(); | 
                                                        
| 25 | -        if(!isset($pageModel)){ | 
                                                        |
| 25 | +        if (!isset($pageModel)) { | 
                                                        |
| 26 | 26 | $pageModel = new PageModel();  | 
                                                        
| 27 | 27 | }  | 
                                                        
| 28 | 28 | $pageModel->page_id = $page->pageId();  | 
                                                        
@@ -10,7 +10,7 @@  | 
                                                    ||
| 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 | public function transfer(CanInteract $anonymous, CanInteract $registered);  | 
                                                        
| 15 | 15 | public function getCountInteractionsOnPage(int $pageId):array;  | 
                                                        
| 16 | 16 | }  | 
                                                        
@@ -11,7 +11,7 @@  | 
                                                    ||
| 11 | 11 |  { | 
                                                        
| 12 | 12 | public function handle($request, Closure $next)  | 
                                                        
| 13 | 13 |      { | 
                                                        
| 14 | -        if($request->input('wiki_session_id')){ | 
                                                        |
| 14 | +        if ($request->input('wiki_session_id')) { | 
                                                        |
| 15 | 15 |              Session::put('wiki_session_id', $request->input('wiki_session_id')); | 
                                                        
| 16 | 16 | }  | 
                                                        
| 17 | 17 | return $next($request);  | 
                                                        
@@ -21,7 +21,7 @@ discard block  | 
                                                    ||
| 21 | 21 |              ->where('page_id', $interaction->pageId()) | 
                                                        
| 22 | 22 | ->first();  | 
                                                        
| 23 | 23 | |
| 24 | -        if($interactionModel === null) { | 
                                                        |
| 24 | +        if ($interactionModel === null) { | 
                                                        |
| 25 | 25 | $interactionModel = new InteractionModel();  | 
                                                        
| 26 | 26 |              $interactionModel->{$canInteract->key()} = isset($user->id) ? $user->id : $canInteract->identifier(); | 
                                                        
| 27 | 27 | }  | 
                                                        
@@ -33,7 +33,7 @@ discard block  | 
                                                    ||
| 33 | 33 | |
| 34 | 34 | public function getByInteractUser(CanInteract $canInteract, int $pageId): ?Interaction  | 
                                                        
| 35 | 35 |      { | 
                                                        
| 36 | -        if($canInteract->key() == 'user_id') { | 
                                                        |
| 36 | +        if ($canInteract->key() == 'user_id') { | 
                                                        |
| 37 | 37 |              $user = User::query()->where('uuid', $canInteract->identifier())->first(); | 
                                                        
| 38 | 38 | }  | 
                                                        
| 39 | 39 | |
@@ -42,7 +42,7 @@ discard block  | 
                                                    ||
| 42 | 42 |              ->where('page_id', $pageId) | 
                                                        
| 43 | 43 | ->first();  | 
                                                        
| 44 | 44 | |
| 45 | -        if(!isset($interactionModel)){ | 
                                                        |
| 45 | +        if (!isset($interactionModel)) { | 
                                                        |
| 46 | 46 | return null;  | 
                                                        
| 47 | 47 | }  | 
                                                        
| 48 | 48 | |