@@ -89,11 +89,13 @@ |
||
89 | 89 | private function getMembers($class, $groups, mixed $arguments = [], int $limit = 0, int $page = 1, array $orderby = []) |
90 | 90 | { |
91 | 91 | |
92 | - if ($limit < 1) |
|
93 | - $limit = $this->request->get('itemsPerPage') ?: 50; |
|
92 | + if ($limit < 1) { |
|
93 | + $limit = $this->request->get('itemsPerPage') ?: 50; |
|
94 | + } |
|
94 | 95 | |
95 | - if ($page == 1) |
|
96 | - $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit; |
|
96 | + if ($page == 1) { |
|
97 | + $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit; |
|
98 | + } |
|
97 | 99 | |
98 | 100 | $data = $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset); |
99 | 101 |
@@ -43,8 +43,9 @@ discard block |
||
43 | 43 | ->getResult() |
44 | 44 | ; |
45 | 45 | |
46 | - if (empty($result)) |
|
47 | - return null; |
|
46 | + if (empty($result)) { |
|
47 | + return null; |
|
48 | + } |
|
48 | 49 | |
49 | 50 | return $result[0]; |
50 | 51 | } |
@@ -78,8 +79,9 @@ discard block |
||
78 | 79 | ->getResult() |
79 | 80 | ; |
80 | 81 | |
81 | - if (empty($result)) |
|
82 | - return null; |
|
82 | + if (empty($result)) { |
|
83 | + return null; |
|
84 | + } |
|
83 | 85 | |
84 | 86 | return $result[0]; |
85 | 87 | } |
@@ -56,15 +56,17 @@ |
||
56 | 56 | |
57 | 57 | $company = $request->query->get('myCompany', null); |
58 | 58 | |
59 | - if ($company === null) |
|
60 | - throw new Exception("Company not found", 404); |
|
59 | + if ($company === null) { |
|
60 | + throw new Exception("Company not found", 404); |
|
61 | + } |
|
61 | 62 | |
62 | 63 | |
63 | 64 | $myCompany = $this->manager->getRepository(People::class) |
64 | 65 | ->find($company); |
65 | 66 | |
66 | - if ($myCompany === null) |
|
67 | - throw new Exception("Company not found", 404); |
|
67 | + if ($myCompany === null) { |
|
68 | + throw new Exception("Company not found", 404); |
|
69 | + } |
|
68 | 70 | |
69 | 71 | |
70 | 72 |
@@ -64,8 +64,9 @@ discard block |
||
64 | 64 | ->getQuery() |
65 | 65 | ->getResult(); |
66 | 66 | |
67 | - if (empty($result)) |
|
68 | - return null; |
|
67 | + if (empty($result)) { |
|
68 | + return null; |
|
69 | + } |
|
69 | 70 | |
70 | 71 | $configs = []; |
71 | 72 | |
@@ -88,8 +89,9 @@ discard block |
||
88 | 89 | ]); |
89 | 90 | |
90 | 91 | |
91 | - if (empty($config) || $config->getConfigValue() != 'itau') |
|
92 | - return null; |
|
92 | + if (empty($config) || $config->getConfigValue() != 'itau') { |
|
93 | + return null; |
|
94 | + } |
|
93 | 95 | |
94 | 96 | $result = $this->createQueryBuilder('a') |
95 | 97 | ->andWhere('a.people = :people') |
@@ -99,8 +101,9 @@ discard block |
||
99 | 101 | ->getQuery() |
100 | 102 | ->getResult(); |
101 | 103 | |
102 | - if (empty($result)) |
|
103 | - return null; |
|
104 | + if (empty($result)) { |
|
105 | + return null; |
|
106 | + } |
|
104 | 107 | |
105 | 108 | $configs = []; |
106 | 109 | |
@@ -125,8 +128,9 @@ discard block |
||
125 | 128 | ->getQuery() |
126 | 129 | ->getResult(); |
127 | 130 | |
128 | - if (empty($result)) |
|
129 | - return null; |
|
131 | + if (empty($result)) { |
|
132 | + return null; |
|
133 | + } |
|
130 | 134 | |
131 | 135 | $configs = []; |
132 | 136 |
@@ -846,8 +846,9 @@ |
||
846 | 846 | |
847 | 847 | protected function getPeopleAddress(People $people): ?array |
848 | 848 | { |
849 | - if (($address = $people->getAddress()->first()) === false) |
|
850 | - return null; |
|
849 | + if (($address = $people->getAddress()->first()) === false) { |
|
850 | + return null; |
|
851 | + } |
|
851 | 852 | |
852 | 853 | return $this->getAddress($address); |
853 | 854 | } |
@@ -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,7 +56,9 @@ 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->getDomain(); |
61 | 64 | self::$peopleDomain = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
@@ -65,10 +68,11 @@ discard block |
||
65 | 68 | self::$peopleDomain = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
66 | 69 | } |
67 | 70 | |
68 | - if (self::$peopleDomain === null) |
|
69 | - throw new \Exception( |
|
71 | + if (self::$peopleDomain === null) { |
|
72 | + throw new \Exception( |
|
70 | 73 | sprintf('Main company "%s" not found', $domain) |
71 | 74 | ); |
75 | + } |
|
72 | 76 | |
73 | 77 | return self::$peopleDomain; |
74 | 78 | } |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | try { |
42 | 42 | $file = $data; |
43 | 43 | //$file = $this->manager->getRepository(File::class)->findOneBy(['url' => $request->getPathInfo()]); |
44 | - if (!$file) |
|
45 | - throw new \Exception('Not found', 404); |
|
44 | + if (!$file) { |
|
45 | + throw new \Exception('Not found', 404); |
|
46 | + } |
|
46 | 47 | |
47 | 48 | |
48 | 49 | $content = $file->getContent(); |
@@ -58,10 +59,11 @@ discard block |
||
58 | 59 | $response->headers->set('Content-Type', "$fileType/$ext"); |
59 | 60 | } |
60 | 61 | |
61 | - if ($fileType == 'image') |
|
62 | - $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, basename($request->getPathInfo())); |
|
63 | - else |
|
64 | - $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, basename($request->getPathInfo())); |
|
62 | + if ($fileType == 'image') { |
|
63 | + $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, basename($request->getPathInfo())); |
|
64 | + } else { |
|
65 | + $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, basename($request->getPathInfo())); |
|
66 | + } |
|
65 | 67 | |
66 | 68 | $response->headers->set('Content-Disposition', $disposition); |
67 | 69 |
@@ -54,8 +54,9 @@ |
||
54 | 54 | if (method_exists($service, $method)) { |
55 | 55 | $newEntity = $service->$method($entity); |
56 | 56 | |
57 | - if ('postPersist' === $method && $newEntity) |
|
58 | - $this->manager->refresh($newEntity); |
|
57 | + if ('postPersist' === $method && $newEntity) { |
|
58 | + $this->manager->refresh($newEntity); |
|
59 | + } |
|
59 | 60 | } |
60 | 61 | } |
61 | 62 | return $entity; |
@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | 'people' => $people, |
30 | 30 | 'configKey' => $key |
31 | 31 | ]); |
32 | - if ($config) |
|
33 | - return $config; |
|
32 | + if ($config) { |
|
33 | + return $config; |
|
34 | + } |
|
34 | 35 | if ($create) { |
35 | 36 | $config = new Config(); |
36 | 37 | $config->setConfigKey($key); |
@@ -108,12 +109,13 @@ discard block |
||
108 | 109 | 'private' |
109 | 110 | ); |
110 | 111 | |
111 | - foreach ($paymentTypes as $paymentType) |
|
112 | - $this->walletService->discoverWalletPaymentType( |
|
112 | + foreach ($paymentTypes as $paymentType) { |
|
113 | + $this->walletService->discoverWalletPaymentType( |
|
113 | 114 | $wallet, |
114 | 115 | $this->walletService->discoverPaymentType($company, $paymentType), |
115 | 116 | $paymentType['paymentCode'] |
116 | 117 | ); |
118 | + } |
|
117 | 119 | } |
118 | 120 | |
119 | 121 | private function discoveryWithdrawlWallet(People $company) |
@@ -139,12 +141,13 @@ discard block |
||
139 | 141 | $module, |
140 | 142 | 'private' |
141 | 143 | ); |
142 | - foreach ($paymentTypes as $paymentType) |
|
143 | - $this->walletService->discoverWalletPaymentType( |
|
144 | + foreach ($paymentTypes as $paymentType) { |
|
145 | + $this->walletService->discoverWalletPaymentType( |
|
144 | 146 | $wallet, |
145 | 147 | $this->walletService->discoverPaymentType($company, $paymentType), |
146 | 148 | $paymentType['paymentCode'] |
147 | 149 | ); |
150 | + } |
|
148 | 151 | } |
149 | 152 | |
150 | 153 | private function discoveryInfinitePayWallet(People $company) |
@@ -184,12 +187,13 @@ discard block |
||
184 | 187 | 'private' |
185 | 188 | ); |
186 | 189 | |
187 | - foreach ($paymentTypes as $paymentType) |
|
188 | - $this->walletService->discoverWalletPaymentType( |
|
190 | + foreach ($paymentTypes as $paymentType) { |
|
191 | + $this->walletService->discoverWalletPaymentType( |
|
189 | 192 | $wallet, |
190 | 193 | $this->walletService->discoverPaymentType($company, $paymentType), |
191 | 194 | $paymentType['paymentCode'] |
192 | 195 | ); |
196 | + } |
|
193 | 197 | } |
194 | 198 | |
195 | 199 | private function discoveryCieloWallet(People $company) |
@@ -261,11 +265,12 @@ discard block |
||
261 | 265 | 'private' |
262 | 266 | ); |
263 | 267 | |
264 | - foreach ($paymentTypes as $paymentType) |
|
265 | - $this->walletService->discoverWalletPaymentType( |
|
268 | + foreach ($paymentTypes as $paymentType) { |
|
269 | + $this->walletService->discoverWalletPaymentType( |
|
266 | 270 | $wallet, |
267 | 271 | $this->walletService->discoverPaymentType($company, $paymentType), |
268 | 272 | $paymentType['paymentCode'] |
269 | 273 | ); |
274 | + } |
|
270 | 275 | } |
271 | 276 | } |