@@ -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 | } |
@@ -59,7 +59,6 @@ |
||
| 59 | 59 | * |
| 60 | 60 | * @ORM\Column(name="cod_ibge", type="integer", nullable=true) |
| 61 | 61 | * @Groups({"city:read","logistic:read","order_details:read", "people:read", "address:read", "delivery_region:read"}) |
| 62 | - |
|
| 63 | 62 | */ |
| 64 | 63 | private $cod_ibge; |
| 65 | 64 | /** |
@@ -51,7 +51,6 @@ |
||
| 51 | 51 | * |
| 52 | 52 | * @ORM\Column(name="cod_ibge", type="integer", nullable=true) |
| 53 | 53 | * @Groups({"city:read","logistic:read","state:read", "order_details:read", "people:read", "address:read", "delivery_region:read"}) |
| 54 | - |
|
| 55 | 54 | */ |
| 56 | 55 | private $cod_ibge; |
| 57 | 56 | /** |