@@ -35,7 +35,9 @@ discard block |
||
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 |
||
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,8 +62,9 @@ discard block |
||
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 | $isFranchisee = $this->isFranchisee($people); |
65 | 70 | if ($isFranchisee) { |
@@ -68,13 +73,15 @@ discard block |
||
68 | 73 | } |
69 | 74 | |
70 | 75 | $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1); |
71 | - if ($isClient) |
|
72 | - $peopleRole[] = 'client'; |
|
76 | + if ($isClient) { |
|
77 | + $peopleRole[] = 'client'; |
|
78 | + } |
|
73 | 79 | |
74 | 80 | |
75 | 81 | $isSalesman = $this->isSalesman($people); |
76 | - if ($isSalesman) |
|
77 | - $peopleRole[] = 'salesman'; |
|
82 | + if ($isSalesman) { |
|
83 | + $peopleRole[] = 'salesman'; |
|
84 | + } |
|
78 | 85 | |
79 | 86 | |
80 | 87 | return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole)); |
@@ -88,7 +95,9 @@ discard block |
||
88 | 95 | public function getMainCompany(): People |
89 | 96 | { |
90 | 97 | |
91 | - if (self::$mainCompany) return self::$mainCompany; |
|
98 | + if (self::$mainCompany) { |
|
99 | + return self::$mainCompany; |
|
100 | + } |
|
92 | 101 | |
93 | 102 | $peopleDomain = $this->domainService->getPeopleDomain(); |
94 | 103 | self::$mainCompany = $peopleDomain->getPeople(); |