Passed
Push — master ( 16c96d...6c6617 )
by Bertrand
06:14
created
app/Src/UseCases/Domain/Organizations/RevokeUserAsAdminOrganization.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 revoke(string $userId, string $organizationId)
20 20
     {
21 21
         $user = $this->userRepository->getById($userId);
22
-        if(!$user->belongsTo($organizationId)){
22
+        if (!$user->belongsTo($organizationId)) {
23 23
             throw new UserGrantAdminException();
24 24
         }
25 25
 
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Organizations/EditOrganization.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function edit(string $organizationId, string $name, array $picture, array $address)
22 22
     {
23 23
         $organization = $this->organizationRepository->get($organizationId);
24
-        if(!isset($organization)){
24
+        if (!isset($organization)) {
25 25
             throw new OrganizationNotFound();
26 26
         }
27 27
         $this->validateData($name, $picture, $address);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Organizations/Model/Organization.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function create(string $ext = 'jpg')
35 35
     {
36
-        if($this->pathPicture !== "") {
36
+        if ($this->pathPicture !== "") {
37 37
             $picture = new Picture($this->pathPicture);
38
-            $picture->resize('app/public/organizations/' . $this->id . '.' . $ext);
39
-            $this->pathPicture = 'app/public/organizations/' . $this->id . '.' . $ext;
38
+            $picture->resize('app/public/organizations/'.$this->id.'.'.$ext);
39
+            $this->pathPicture = 'app/public/organizations/'.$this->id.'.'.$ext;
40 40
         }
41 41
 
42 42
         app(OrganizationRepository::class)->add($this);
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $this->name = $name;
48 48
         $this->address = $address;
49
-        if($picture['path'] !== "") {
49
+        if ($picture['path'] !== "") {
50 50
             $logo = new Picture($picture['path']);
51 51
             $ext = $picture['ext'];
52
-            $logo->resize('app/public/organizations/' . $this->id . '.' . $ext);
53
-            $this->pathPicture = 'app/public/organizations/' . $this->id . '.' . $ext;
52
+            $logo->resize('app/public/organizations/'.$this->id.'.'.$ext);
53
+            $this->pathPicture = 'app/public/organizations/'.$this->id.'.'.$ext;
54 54
         }
55 55
         app(OrganizationRepository::class)->update($this);
56 56
     }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Organizations/GrantUserAsAdminOrganization.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 grant(string $userId, string $organizationId)
20 20
     {
21 21
         $user = $this->userRepository->getById($userId);
22
-        if(!$user->belongsTo($organizationId)){
22
+        if (!$user->belongsTo($organizationId)) {
23 23
             throw new UserGrantAdminException();
24 24
         }
25 25
 
Please login to merge, or discard this patch.
app/Console/Commands/ImportCharacteristicsFromWiki.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     // @see https://wiki.tripleperformance.fr/wiki/Aide:Requettes_Insights
22 22
     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";
23
-    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";
23
+    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 24
 
25 25
 
26 26
     public function __construct()
@@ -45,25 +45,25 @@  discard block
 block discarded – undo
45 45
         $content = json_decode($response->getBody()->getContents(), true);
46 46
         $characteristics = $content['query']['results'];
47 47
 
48
-        foreach ($characteristics as $key => $characteristic){
48
+        foreach ($characteristics as $key => $characteristic) {
49 49
             $page = key($characteristic);
50 50
             $characteristic = last($characteristic);
51 51
 
52 52
             $uuid = Uuid::uuid4();
53 53
             $path = '';
54
-            if(isset($characteristic['printouts']['A un fichier d\'icone de caractéristique'][0]['fulltext'])) {
54
+            if (isset($characteristic['printouts']['A un fichier d\'icone de caractéristique'][0]['fulltext'])) {
55 55
                 $picture = $characteristic['printouts']['A un fichier d\'icone de caractéristique'][0]['fulltext'];
56 56
                 $picturesApiUri = config('wiki.api_uri').$queryPictures.$picture;
57 57
 
58 58
                 $response = $this->httpClient->get($picturesApiUri);
59 59
                 $content = json_decode($response->getBody()->getContents(), true);
60 60
                 $picturesInfo = $content['query']['pages'];
61
-                foreach($picturesInfo as $picture) {
61
+                foreach ($picturesInfo as $picture) {
62 62
                     if (isset(last($picture['imageinfo'])['url'])) {
63 63
                         $response = $this->httpClient->get(last($picture['imageinfo'])['url']);
64 64
                         $content = $response->getBody()->getContents();
65
-                        $path = 'public/characteristics/'.$uuid .'.png';
66
-                        Storage::put('public/characteristics/' . $uuid . '.png', $content);
65
+                        $path = 'public/characteristics/'.$uuid.'.png';
66
+                        Storage::put('public/characteristics/'.$uuid.'.png', $content);
67 67
                     }
68 68
                 }
69 69
             }
@@ -81,17 +81,17 @@  discard block
 block discarded – undo
81 81
             $characteristicsToSave = [
82 82
                 'uuid' => $uuid,
83 83
                 'main' => $main,
84
-                'priority' => (int)last($characteristic['printouts']['A une priorité d\'affichage']),
84
+                'priority' => (int) last($characteristic['printouts']['A une priorité d\'affichage']),
85 85
                 'icon' => $path,
86 86
                 'page_label' => $label,
87 87
                 'pretty_page_label' => $prettyPage,
88
-                'page_id' => (int)$pageInfo['pageid'],
88
+                'page_id' => (int) $pageInfo['pageid'],
89 89
                 'type' => $type,
90 90
                 'code' => $pageInfo['title']
91 91
             ];
92 92
 
93
-            $model = CharacteristicsModel::where('page_id', (int)$pageInfo['pageid'])->first();
94
-            if(!isset($model)) {
93
+            $model = CharacteristicsModel::where('page_id', (int) $pageInfo['pageid'])->first();
94
+            if (!isset($model)) {
95 95
                 $model = new CharacteristicsModel();
96 96
             }
97 97
             $model->fill($characteristicsToSave);
Please login to merge, or discard this patch.