@@ -34,7 +34,9 @@ discard block |
||
34 | 34 | */ |
35 | 35 | foreach ($getPeopleCompanies as $peopleCompany) { |
36 | 36 | $isFranchisee = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $peopleCompany->getCompany(), 'franchisee', 1); |
37 | - if ($isFranchisee) return true; |
|
37 | + if ($isFranchisee) { |
|
38 | + return true; |
|
39 | + } |
|
38 | 40 | } |
39 | 41 | return $isFranchisee; |
40 | 42 | } |
@@ -46,7 +48,9 @@ discard block |
||
46 | 48 | $isSalesman = false; |
47 | 49 | |
48 | 50 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1); |
49 | - if ($isSalesman) return true; |
|
51 | + if ($isSalesman) { |
|
52 | + return true; |
|
53 | + } |
|
50 | 54 | |
51 | 55 | $getPeopleCompanies = $this->manager->getRepository(PeopleLink::class)->findBy([ |
52 | 56 | 'people' => $people, |
@@ -57,7 +61,9 @@ discard block |
||
57 | 61 | */ |
58 | 62 | foreach ($getPeopleCompanies as $peopleCompany) { |
59 | 63 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $peopleCompany->getCompany(), 'salesman', 1); |
60 | - if ($isSalesman) return true; |
|
64 | + if ($isSalesman) { |
|
65 | + return true; |
|
66 | + } |
|
61 | 67 | } |
62 | 68 | return $isSalesman; |
63 | 69 | } |
@@ -69,8 +75,9 @@ discard block |
||
69 | 75 | $mainCompany = $this->getMainCompany(); |
70 | 76 | |
71 | 77 | $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1); |
72 | - if ($isSuper) |
|
73 | - $peopleRole[] = 'super'; |
|
78 | + if ($isSuper) { |
|
79 | + $peopleRole[] = 'super'; |
|
80 | + } |
|
74 | 81 | |
75 | 82 | |
76 | 83 | |
@@ -81,13 +88,15 @@ discard block |
||
81 | 88 | } |
82 | 89 | |
83 | 90 | $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1); |
84 | - if ($isClient) |
|
85 | - $peopleRole[] = 'client'; |
|
91 | + if ($isClient) { |
|
92 | + $peopleRole[] = 'client'; |
|
93 | + } |
|
86 | 94 | |
87 | 95 | |
88 | 96 | $isSalesman = $this->isSalesman($people); |
89 | - if ($isSalesman) |
|
90 | - $peopleRole[] = 'salesman'; |
|
97 | + if ($isSalesman) { |
|
98 | + $peopleRole[] = 'salesman'; |
|
99 | + } |
|
91 | 100 | |
92 | 101 | |
93 | 102 | return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole)); |
@@ -101,7 +110,9 @@ discard block |
||
101 | 110 | public function getMainCompany(): People |
102 | 111 | { |
103 | 112 | |
104 | - if (self::$mainCompany) return self::$mainCompany; |
|
113 | + if (self::$mainCompany) { |
|
114 | + return self::$mainCompany; |
|
115 | + } |
|
105 | 116 | |
106 | 117 | $peopleDomain = $this->domainService->getPeopleDomain(); |
107 | 118 | self::$mainCompany = $peopleDomain->getPeople(); |