Completed
Pull Request — master (#77)
by guillaume
07:58
created
app/Src/UseCases/Domain/Users/Interactions/HandleInteractions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Agricultural/Model/Interaction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Src/UseCases/Domain/Agricultural/Queries/InteractionsQueryByPageAndUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/PageRepositorySql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
app/Http/Middleware/SetWikiSessionId.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Shared/Gateway/AuthGateway.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
-    public function wikiSessionId():?string;
13
+    public function wikiSessionId(): ?string;
14 14
 }
Please login to merge, or discard this patch.
app/Console/Commands/SyncDryPagesFromWiki.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $httpClient = new Client();
25 25
 
26
-        PageModel::query()->where('dry', true)->chunkById(50, function ($items, $count) use($httpClient){
26
+        PageModel::query()->where('dry', true)->chunkById(50, function($items, $count) use($httpClient){
27 27
             $this->info(($count*50).' Pages');
28 28
             $pages = $items->pluck('page_id')->toArray();
29 29
             $pagesApiUri = config('wiki.api_uri').$this->queryPages.implode('|', $pages);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             $content = json_decode($response->getBody()->getContents(), true);
32 32
             $wikiPages = $content['query']['pages'];
33 33
 
34
-            foreach($wikiPages as $page){
34
+            foreach ($wikiPages as $page) {
35 35
                 $pageModel = PageModel::query()->where('page_id', $page['pageid'])->first();
36 36
                 $pageModel->dry = false;
37 37
                 $pageModel->title = $page['title'];
Please login to merge, or discard this patch.
app/Http/Controllers/Api/InteractionController.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
      * @bodyParam interactions string[] required The user's interactions on the page. Example: unapplause, done
26 26
      */
27 27
     public function handle($pageId, Request $request,
28
-                           HandleInteractions $handleInteractions,
29
-                           InteractionsQueryByPageAndUser $interactionsQueryByPageAndUser,
30
-                           CountInteractionsOnPageQuery $countInteractionsOnPage
28
+                            HandleInteractions $handleInteractions,
29
+                            InteractionsQueryByPageAndUser $interactionsQueryByPageAndUser,
30
+                            CountInteractionsOnPageQuery $countInteractionsOnPage
31 31
     )
32 32
     {
33 33
         $interactions = $request->input('interactions');
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/System/SetPageDryState.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     public function execute(int $pageId)
20 20
     {
21 21
         $page = $this->pageRepository->get($pageId);
22
-        if($page === null){
22
+        if ($page === null) {
23 23
             $page = new Page($pageId, true);
24 24
             $this->pageRepository->save($page);
25 25
             return;
Please login to merge, or discard this patch.