@@ -66,8 +66,9 @@ discard block |
||
66 | 66 | $mainCompany = $this->getMainCompany(); |
67 | 67 | |
68 | 68 | $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1); |
69 | - if ($isSuper) |
|
70 | - $peopleRole[] = 'super'; |
|
69 | + if ($isSuper) { |
|
70 | + $peopleRole[] = 'super'; |
|
71 | + } |
|
71 | 72 | |
72 | 73 | $isFranchisee = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'franchisee', 1); |
73 | 74 | if ($isFranchisee) { |
@@ -76,13 +77,15 @@ discard block |
||
76 | 77 | } |
77 | 78 | |
78 | 79 | $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1); |
79 | - if ($isClient) |
|
80 | - $peopleRole[] = 'client'; |
|
80 | + if ($isClient) { |
|
81 | + $peopleRole[] = 'client'; |
|
82 | + } |
|
81 | 83 | |
82 | 84 | |
83 | 85 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1); |
84 | - if ($isSalesman) |
|
85 | - $peopleRole[] = 'salesman'; |
|
86 | + if ($isSalesman) { |
|
87 | + $peopleRole[] = 'salesman'; |
|
88 | + } |
|
86 | 89 | |
87 | 90 | |
88 | 91 | return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole)); |
@@ -98,10 +101,11 @@ discard block |
||
98 | 101 | $domain = $this->domainService->getMainDomain(); |
99 | 102 | $company = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
100 | 103 | |
101 | - if ($company === null) |
|
102 | - throw new \Exception( |
|
104 | + if ($company === null) { |
|
105 | + throw new \Exception( |
|
103 | 106 | sprintf('Main company "%s" not found', $domain) |
104 | 107 | ); |
108 | + } |
|
105 | 109 | |
106 | 110 | return $company->getPeople(); |
107 | 111 | } |
@@ -260,12 +260,13 @@ |
||
260 | 260 | |
261 | 261 | private function getLogo(People $company): ?array |
262 | 262 | { |
263 | - if ($company->getFile() instanceof File) |
|
264 | - return [ |
|
263 | + if ($company->getFile() instanceof File) { |
|
264 | + return [ |
|
265 | 265 | 'id' => $company->getFile()->getId(), |
266 | 266 | 'domain' => $this->domainService->getMainDomain(), |
267 | 267 | 'url' => '/files/download/' . $company->getFile()->getId() |
268 | 268 | ]; |
269 | + } |
|
269 | 270 | |
270 | 271 | return null; |
271 | 272 | } |