Passed
Push — master ( 0fd630...01f13f )
by Luiz Kim
02:25
created
src/Service/PeopleRoleService.php 1 patch
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@  discard block
 block discarded – undo
34 34
     $isSalesman = false;
35 35
 
36 36
     $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1);
37
-    if ($isSalesman) return true;
37
+    if ($isSalesman) {
38
+     return true;
39
+    }
38 40
 
39 41
     $getPeopleCompanies = $this->manager->getRepository(PeopleLink::class)->findBy([
40 42
       'people' => $people,
@@ -45,7 +47,9 @@  discard block
 block discarded – undo
45 47
      */
46 48
     foreach ($getPeopleCompanies as $peopleCompany) {
47 49
       $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $peopleCompany->getCompany(), 'salesman', 1);
48
-      if ($isSalesman) return true;
50
+      if ($isSalesman) {
51
+       return true;
52
+      }
49 53
     }
50 54
     return $isSalesman;
51 55
   }
@@ -57,8 +61,9 @@  discard block
 block discarded – undo
57 61
     $mainCompany = $this->getMainCompany();
58 62
 
59 63
     $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1);
60
-    if ($isSuper)
61
-      $peopleRole[] = 'super';
64
+    if ($isSuper) {
65
+          $peopleRole[] = 'super';
66
+    }
62 67
 
63 68
 
64 69
 
@@ -69,13 +74,15 @@  discard block
 block discarded – undo
69 74
     }
70 75
 
71 76
     $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1);
72
-    if ($isClient)
73
-      $peopleRole[] = 'client';
77
+    if ($isClient) {
78
+          $peopleRole[] = 'client';
79
+    }
74 80
 
75 81
 
76 82
     $isSalesman = $this->isSalesman($people);
77
-    if ($isSalesman)
78
-      $peopleRole[] = 'salesman';
83
+    if ($isSalesman) {
84
+          $peopleRole[] = 'salesman';
85
+    }
79 86
 
80 87
 
81 88
     return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole));
@@ -89,7 +96,9 @@  discard block
 block discarded – undo
89 96
   public function getMainCompany(): People
90 97
   {
91 98
 
92
-    if (self::$mainCompany) return self::$mainCompany;
99
+    if (self::$mainCompany) {
100
+     return self::$mainCompany;
101
+    }
93 102
 
94 103
     $peopleDomain = $this->domainService->getPeopleDomain();
95 104
     self::$mainCompany =  $peopleDomain->getPeople();
Please login to merge, or discard this patch.