Passed
Push — master ( 05f644...4f98bc )
by guillaume
01:53 queued 16s
created
app/Src/UseCases/Infra/Sql/InteractionPageRepositorySql.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
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/Console/Commands/ImportAllPagesFromWiki.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         $this->handlePages($pages);
35 35
         $continue = $content['continue']['gapcontinue'];
36 36
 
37
-        while($continue !== null && $continue !== ''){
37
+        while ($continue !== null && $continue !== '') {
38 38
             $this->info($continue);
39 39
 
40 40
             $pagesApiUri = config('wiki.api_uri').$queryPages.'&gapcontinue='.$continue;
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Gateway/SessionAuthGateway.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public function current(): ?User
15 15
     {
16 16
         $userModel = Auth::user();
17
-        if(!isset($userModel)){
17
+        if (!isset($userModel)) {
18 18
             return null;
19 19
         }
20 20
         return new User($userModel->uuid, $userModel->email, $userModel->firstname, $userModel->lastname, $userModel->organization_id);
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         Auth::login($authenticate, true);
27 27
     }
28 28
 
29
-    public function wikiSessionId():? string
29
+    public function wikiSessionId(): ? string
30 30
     {
31 31
         return Session::get('wiki_session_id');
32 32
     }
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.
app/Console/Commands/ImportCharacteristicsFromWiki.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     // @see https://wiki.tripleperformance.fr/wiki/Aide:Requettes_Insights
23 23
     private $queryFarming = "?action=ask&api_version=3&query=[[Est un élément de profil::Production]]|?A un fichier d'icone de caractéristique|?Doit être affiché par défaut|?A une priorité d'affichage|?A un label|sort=A une priorité d'affichage|order=asc&format=json";
24
-    private $queryCroppingSystem  = "?action=ask&api_version=3&query=[[Est un élément de profil::Cahier des charges]]|?A un fichier d'icone de caractéristique|?Doit être affiché par défaut|?A une priorité d'affichage|?A un label|sort=A une priorité d'affichage|order=asc&format=json";
24
+    private $queryCroppingSystem = "?action=ask&api_version=3&query=[[Est un élément de profil::Cahier des charges]]|?A un fichier d'icone de caractéristique|?Doit être affiché par défaut|?A une priorité d'affichage|?A un label|sort=A une priorité d'affichage|order=asc&format=json";
25 25
 
26 26
 
27 27
     public function __construct()
@@ -46,27 +46,27 @@  discard block
 block discarded – undo
46 46
         $content = json_decode($response->getBody()->getContents(), true);
47 47
         $characteristics = $content['query']['results'];
48 48
 
49
-        foreach ($characteristics as $key => $characteristic){
49
+        foreach ($characteristics as $key => $characteristic) {
50 50
             $page = key($characteristic);
51 51
             $characteristic = last($characteristic);
52 52
 
53 53
             $uuid = Uuid::uuid4();
54 54
             $path = '';
55
-            if(isset($characteristic['printouts']['A un fichier d\'icone de caractéristique'][0]['fulltext'])) {
55
+            if (isset($characteristic['printouts']['A un fichier d\'icone de caractéristique'][0]['fulltext'])) {
56 56
                 $picture = $characteristic['printouts']['A un fichier d\'icone de caractéristique'][0]['fulltext'];
57 57
                 $picturesApiUri = config('wiki.api_uri').$queryPictures.$picture;
58 58
 
59 59
                 $response = $this->httpClient->get($picturesApiUri);
60 60
                 $content = json_decode($response->getBody()->getContents(), true);
61 61
                 $picturesInfo = $content['query']['pages'];
62
-                foreach($picturesInfo as $picture) {
62
+                foreach ($picturesInfo as $picture) {
63 63
                     if (isset(last($picture['imageinfo'])['url'])) {
64 64
                         try {
65 65
                             $response = $this->httpClient->get(last($picture['imageinfo'])['url']);
66 66
                             $content = $response->getBody()->getContents();
67
-                            $path = 'public/characteristics/' . $uuid . '.png';
68
-                            Storage::put('public/characteristics/' . $uuid . '.png', $content);
69
-                        }catch (ClientException $e){
67
+                            $path = 'public/characteristics/'.$uuid.'.png';
68
+                            Storage::put('public/characteristics/'.$uuid.'.png', $content);
69
+                        } catch (ClientException $e) {
70 70
                             $path = '';
71 71
                         }
72 72
                     }
@@ -86,17 +86,17 @@  discard block
 block discarded – undo
86 86
             $characteristicsToSave = [
87 87
                 'uuid' => $uuid,
88 88
                 'main' => $main,
89
-                'priority' => (int)last($characteristic['printouts']['A une priorité d\'affichage']),
89
+                'priority' => (int) last($characteristic['printouts']['A une priorité d\'affichage']),
90 90
                 'icon' => $path,
91 91
                 'page_label' => $label,
92 92
                 'pretty_page_label' => $prettyPage,
93
-                'page_id' => (int)$pageInfo['pageid'],
93
+                'page_id' => (int) $pageInfo['pageid'],
94 94
                 'type' => $type,
95 95
                 'code' => $pageInfo['title']
96 96
             ];
97 97
 
98
-            $model = CharacteristicsModel::where('page_id', (int)$pageInfo['pageid'])->first();
99
-            if(!isset($model)) {
98
+            $model = CharacteristicsModel::where('page_id', (int) $pageInfo['pageid'])->first();
99
+            if (!isset($model)) {
100 100
                 $model = new CharacteristicsModel();
101 101
             }
102 102
             $model->fill($characteristicsToSave);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
                             $content = $response->getBody()->getContents();
67 67
                             $path = 'public/characteristics/' . $uuid . '.png';
68 68
                             Storage::put('public/characteristics/' . $uuid . '.png', $content);
69
-                        }catch (ClientException $e){
69
+                        } catch (ClientException $e){
70 70
                             $path = '';
71 71
                         }
72 72
                     }
Please login to merge, or discard this patch.