Passed
Push — master ( 7889cb...c73812 )
by Luiz Kim
02:03
created
src/Service/PeopleRoleService.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@  discard block
 block discarded – undo
64 64
     $mainCompany = $this->getMainCompany();
65 65
 
66 66
     $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1);
67
-    if ($isSuper) 
68
-      $peopleRole[] = 'super';
67
+    if ($isSuper) {
68
+          $peopleRole[] = 'super';
69
+    }
69 70
 
70 71
     $isFranchisee = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'franchisee', 1);
71 72
     if ($isFranchisee) {
@@ -74,13 +75,15 @@  discard block
 block discarded – undo
74 75
     }
75 76
 
76 77
     $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1);
77
-    if ($isClient) 
78
-      $peopleRole[] = 'client';
78
+    if ($isClient) {
79
+          $peopleRole[] = 'client';
80
+    }
79 81
     
80 82
 
81 83
     $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1);
82
-    if ($isSalesman) 
83
-      $peopleRole[] = 'salesman';
84
+    if ($isSalesman) {
85
+          $peopleRole[] = 'salesman';
86
+    }
84 87
     
85 88
 
86 89
     return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole));
@@ -96,10 +99,11 @@  discard block
 block discarded – undo
96 99
     $domain  = $_SERVER['HTTP_HOST'];
97 100
     $company = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]);
98 101
 
99
-    if ($company === null)
100
-      throw new \Exception(
102
+    if ($company === null) {
103
+          throw new \Exception(
101 104
         sprintf('Main company "%s" not found', $domain)
102 105
       );
106
+    }
103 107
 
104 108
     return $company->getPeople();
105 109
   }
Please login to merge, or discard this patch.