@@ -66,7 +66,6 @@ |
||
| 66 | 66 | * |
| 67 | 67 | * @ORM\Column(name="background", type="integer", nullable=true) |
| 68 | 68 | * @Groups({"theme:read"}) |
| 69 | - |
|
| 70 | 69 | */ |
| 71 | 70 | private $background; |
| 72 | 71 | /** |
@@ -19,13 +19,13 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function getFileUrl(People $people): ?array |
| 21 | 21 | { |
| 22 | - if ($people->getImage() instanceof File) |
|
| 22 | + if ($people->getImage() instanceof File) |
|
| 23 | 23 | return [ |
| 24 | - 'id' => $people->getImage()->getId(), |
|
| 25 | - 'domain' => $this->domainService->getMainDomain(), |
|
| 26 | - 'url' => '/files/' . $people->getImage()->getId() . '/download' |
|
| 24 | + 'id' => $people->getImage()->getId(), |
|
| 25 | + 'domain' => $this->domainService->getMainDomain(), |
|
| 26 | + 'url' => '/files/' . $people->getImage()->getId() . '/download' |
|
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | - return null; |
|
| 29 | + return null; |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -19,12 +19,13 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function getFileUrl(People $people): ?array |
| 21 | 21 | { |
| 22 | - if ($people->getImage() instanceof File) |
|
| 23 | - return [ |
|
| 22 | + if ($people->getImage() instanceof File) { |
|
| 23 | + return [ |
|
| 24 | 24 | 'id' => $people->getImage()->getId(), |
| 25 | 25 | 'domain' => $this->domainService->getMainDomain(), |
| 26 | 26 | 'url' => '/files/' . $people->getImage()->getId() . '/download' |
| 27 | 27 | ]; |
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | return null; |
| 30 | 31 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | { |
| 58 | 58 | if (self::$peopleDomain) return self::$peopleDomain; |
| 59 | 59 | |
| 60 | - $domain = $this->getMainDomain(); |
|
| 60 | + $domain = $this->getMainDomain(); |
|
| 61 | 61 | self::$peopleDomain = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
| 62 | 62 | |
| 63 | 63 | if (self::$peopleDomain === null) |
@@ -43,8 +43,9 @@ discard block |
||
| 43 | 43 | ) |
| 44 | 44 | )); |
| 45 | 45 | |
| 46 | - if (!$domain) |
|
| 47 | - throw new InvalidArgumentException('Please define header or get param "app-domain"', 301); |
|
| 46 | + if (!$domain) { |
|
| 47 | + throw new InvalidArgumentException('Please define header or get param "app-domain"', 301); |
|
| 48 | + } |
|
| 48 | 49 | return $domain; |
| 49 | 50 | } |
| 50 | 51 | |
@@ -55,15 +56,18 @@ discard block |
||
| 55 | 56 | |
| 56 | 57 | public function getPeopleDomain(): PeopleDomain |
| 57 | 58 | { |
| 58 | - if (self::$peopleDomain) return self::$peopleDomain; |
|
| 59 | + if (self::$peopleDomain) { |
|
| 60 | + return self::$peopleDomain; |
|
| 61 | + } |
|
| 59 | 62 | |
| 60 | 63 | $domain = $this->getMainDomain(); |
| 61 | 64 | self::$peopleDomain = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
| 62 | 65 | |
| 63 | - if (self::$peopleDomain === null) |
|
| 64 | - throw new \Exception( |
|
| 66 | + if (self::$peopleDomain === null) { |
|
| 67 | + throw new \Exception( |
|
| 65 | 68 | sprintf('Main company "%s" not found', $domain) |
| 66 | 69 | ); |
| 70 | + } |
|
| 67 | 71 | |
| 68 | 72 | return self::$peopleDomain; |
| 69 | 73 | } |