@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | $payload = json_decode($request->getContent()); |
| 38 | 38 | if (isset($payload->link_type)) { |
| 39 | 39 | $company = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->company)); |
| 40 | - if ($company) |
|
| 41 | - $this->addLink($company, $people, $payload->link_type); |
|
| 42 | - else { |
|
| 40 | + if ($company) { |
|
| 41 | + $this->addLink($company, $people, $payload->link_type); |
|
| 42 | + } else { |
|
| 43 | 43 | $link = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->link)); |
| 44 | 44 | if ($payload->link_type == 'employee' && $link) { |
| 45 | 45 | $this->addLink($people, $link, $payload->link_type); |
@@ -67,8 +67,9 @@ discard block |
||
| 67 | 67 | 'link_type' => $link_type |
| 68 | 68 | ]); |
| 69 | 69 | |
| 70 | - if (!$peopleLink) |
|
| 71 | - $peopleLink = new PeopleLink(); |
|
| 70 | + if (!$peopleLink) { |
|
| 71 | + $peopleLink = new PeopleLink(); |
|
| 72 | + } |
|
| 72 | 73 | |
| 73 | 74 | $peopleLink->setCompany($company); |
| 74 | 75 | $peopleLink->setPeople($people); |
@@ -123,8 +124,9 @@ discard block |
||
| 123 | 124 | */ |
| 124 | 125 | $currentUser = $this->security->getUser(); |
| 125 | 126 | $companies = []; |
| 126 | - if (!$currentUser) |
|
| 127 | - return []; |
|
| 127 | + if (!$currentUser) { |
|
| 128 | + return []; |
|
| 129 | + } |
|
| 128 | 130 | |
| 129 | 131 | if (!$currentUser->getPeople()->getLink()->isEmpty()) { |
| 130 | 132 | foreach ($currentUser->getPeople()->getLink() as $company) { |