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