Passed
Push — master ( 9b4bfd...88cf06 )
by Luiz Kim
18:56 queued 16:44
created
src/Service/PeopleRoleService.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -66,8 +66,9 @@  discard block
 block discarded – undo
66 66
     $mainCompany = $this->getMainCompany();
67 67
 
68 68
     $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1);
69
-    if ($isSuper) 
70
-      $peopleRole[] = 'super';
69
+    if ($isSuper) {
70
+          $peopleRole[] = 'super';
71
+    }
71 72
 
72 73
     $isFranchisee = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'franchisee', 1);
73 74
     if ($isFranchisee) {
@@ -76,13 +77,15 @@  discard block
 block discarded – undo
76 77
     }
77 78
 
78 79
     $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1);
79
-    if ($isClient) 
80
-      $peopleRole[] = 'client';
80
+    if ($isClient) {
81
+          $peopleRole[] = 'client';
82
+    }
81 83
     
82 84
 
83 85
     $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1);
84
-    if ($isSalesman) 
85
-      $peopleRole[] = 'salesman';
86
+    if ($isSalesman) {
87
+          $peopleRole[] = 'salesman';
88
+    }
86 89
     
87 90
 
88 91
     return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole));
@@ -98,10 +101,11 @@  discard block
 block discarded – undo
98 101
     $domain  = $this->domainService->getMainDomain();
99 102
     $company = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]);
100 103
 
101
-    if ($company === null)
102
-      throw new \Exception(
104
+    if ($company === null) {
105
+          throw new \Exception(
103 106
         sprintf('Main company "%s" not found', $domain)
104 107
       );
108
+    }
105 109
 
106 110
     return $company->getPeople();
107 111
   }
Please login to merge, or discard this patch.
src/Controller/GetMyCompaniesAction.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
   PeopleRoleService $roles)
32 32
   {
33 33
     $this->security = $security;
34
-    $this->em      = $entityManager;
34
+    $this->em = $entityManager;
35 35
     $this->roles = $roles;
36 36
   }
37 37
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             }
139 139
           }
140 140
 
141
-          $peopleemployee =   $this->em->getRepository(PeopleLink::class)->findOneBy(['company' => $company, 'employee' => $userPeople]);
141
+          $peopleemployee = $this->em->getRepository(PeopleLink::class)->findOneBy(['company' => $company, 'employee' => $userPeople]);
142 142
 
143 143
           $permissions[$company->getId()][] = 'salesman';
144 144
           $myCompanies[$company->getId()] = [
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $myCompanies[$key]['permission'] = array_values($permission);
167 167
       }
168 168
 
169
-      usort($myCompanies, function ($a, $b) {
169
+      usort($myCompanies, function($a, $b) {
170 170
 
171 171
         if ($a['alias'] == $b['alias']) {
172 172
           return 0;
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
         $p_m[$package_module->getId()]['module'] = $package_module->getModule()->getName();
213 213
       }
214 214
 
215
-      $packages[$people_package->getId()]['id']                   =  $people_package->getId();
216
-      $packages[$people_package->getId()]['package']['id']        =  $package->getId();
217
-      $packages[$people_package->getId()]['package']['name']      =  $package->getName();
218
-      $packages[$people_package->getId()]['package']['active']    =  $package->isActive() ? true : false;
219
-      $packages[$people_package->getId()]['package']['modules']   =  $p_m;
215
+      $packages[$people_package->getId()]['id']                   = $people_package->getId();
216
+      $packages[$people_package->getId()]['package']['id']        = $package->getId();
217
+      $packages[$people_package->getId()]['package']['name']      = $package->getName();
218
+      $packages[$people_package->getId()]['package']['active']    = $package->isActive() ? true : false;
219
+      $packages[$people_package->getId()]['package']['modules']   = $p_m;
220 220
     }
221 221
 
222 222
     return $packages;
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     /**
252 252
      * @var \ControleOnline\Entity\Document $document
253 253
      */
254
-    $documents = $documents->filter(function ($document) {
254
+    $documents = $documents->filter(function($document) {
255 255
       return $document->getDocumentType()->getDocumentType() == 'CNPJ';
256 256
     });
257 257
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
       return [
265 265
         'id'     => $company->getFile()->getId(),
266 266
         'domain' => $this->domainService->getMainDomain(),
267
-        'url'    => '/files/download/' . $company->getFile()->getId()
267
+        'url'    => '/files/download/'.$company->getFile()->getId()
268 268
       ];
269 269
 
270 270
     return null;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -260,12 +260,13 @@
 block discarded – undo
260 260
 
261 261
   private function getLogo(People $company): ?array
262 262
   {
263
-    if ($company->getFile() instanceof File)
264
-      return [
263
+    if ($company->getFile() instanceof File) {
264
+          return [
265 265
         'id'     => $company->getFile()->getId(),
266 266
         'domain' => $this->domainService->getMainDomain(),
267 267
         'url'    => '/files/download/' . $company->getFile()->getId()
268 268
       ];
269
+    }
269 270
 
270 271
     return null;
271 272
   }
Please login to merge, or discard this patch.
src/Controller/GetDefaultCompanyAction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
           'logo'       => $this->company->getPeople()->getFile() ? [
72 72
             'id'     => $this->company->getPeople()->getFile()->getId(),
73 73
             'domain' => $this->domainService->getMainDomain(),
74
-            'url'    => '/files/download/' . $this->company->getPeople()->getFile()->getId()
74
+            'url'    => '/files/download/'.$this->company->getPeople()->getFile()->getId()
75 75
           ] : null,
76 76
         ];
77 77
       }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
       'background'  =>  $this->company->getTheme()->getBackground() ? [
110 110
         'id'     =>  $this->company->getTheme()->getBackground(),
111 111
         'domain' => $this->domainService->getMainDomain(),
112
-        'url'    => '/files/download/' .  $this->company->getTheme()->getBackground()
112
+        'url'    => '/files/download/'.$this->company->getTheme()->getBackground()
113 113
       ] : null,
114 114
     ];
115 115
   }
Please login to merge, or discard this patch.