@@ -34,7 +34,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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(); |