Passed
Push — master ( e64e6c...5e2659 )
by Luiz Kim
02:51 queued 32s
created
src/Service/PeopleService.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     private Security               $security,
28 28
     private RequestStack $requestStack,
29 29
   ) {
30
-    $this->request  = $requestStack->getCurrentRequest();
30
+    $this->request = $requestStack->getCurrentRequest();
31 31
   }
32 32
 
33 33
   public function prePersist(People $people)
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     $phone = $this->getPhone($phone_number['ddd'], $phone_number['phone']);
79 79
     if ($phone && $phone->getPeople()) {
80 80
       if ($phone->getPeople()->getId() != $people->getId())
81
-        throw new Exception("Phone is in use by people " . $people->getId(), 1);
81
+        throw new Exception("Phone is in use by people ".$people->getId(), 1);
82 82
     } else {
83 83
       $phone = new Phone();
84 84
       $phone->setDdd($phone_number['ddd']);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     $document = $this->getDocument($document_number, $document_type);
96 96
     if ($document) {
97 97
       if ($document->getPeople()->getId() != $people->getId())
98
-        throw new Exception("Document is in use by people " . $people->getId(), 1);
98
+        throw new Exception("Document is in use by people ".$people->getId(), 1);
99 99
     } else {
100 100
       $document = new Document();
101 101
       $document->setDocument($document_number);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     $email = $this->getEmail($email_str);
114 114
     if ($email && $email->getPeople()) {
115 115
       if ($email->getPeople()->getId() != $people->getId())
116
-        throw new Exception("Email is in use by people " . $people->getId(), 1);
116
+        throw new Exception("Email is in use by people ".$people->getId(), 1);
117 117
     } else {
118 118
       $email = new Email();
119 119
       $email->setEmail($email_str);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
   public function discoveryDocumentType(string $document_type): DocumentType
140 140
   {
141
-    $documentType =  $this->manager->getRepository(DocumentType::class)->findOneBy(['documentType' => $document_type]);
141
+    $documentType = $this->manager->getRepository(DocumentType::class)->findOneBy(['documentType' => $document_type]);
142 142
 
143 143
     if (!$documentType) {
144 144
       $documentType = new DocumentType();
@@ -214,29 +214,29 @@  discard block
 block discarded – undo
214 214
   public function checkLink(QueryBuilder $queryBuilder, $resourceClass = null, $applyTo = null, $rootAlias = null): void
215 215
   {
216 216
 
217
-    $link   = $this->request->query->get('link',   null);
217
+    $link = $this->request->query->get('link', null);
218 218
     $company = $this->request->query->get('company', null);
219 219
     $link_type = $this->request->query->get('link_type', null);
220 220
 
221 221
     if ($link_type) {
222
-      $queryBuilder->join(sprintf('%s.' . ($link ? 'company' : 'link'), $rootAlias), 'PeopleLink');
222
+      $queryBuilder->join(sprintf('%s.'.($link ? 'company' : 'link'), $rootAlias), 'PeopleLink');
223 223
       $queryBuilder->andWhere('PeopleLink.link_type IN(:link_type)');
224 224
       $queryBuilder->setParameter('link_type', $link_type);
225 225
     }
226 226
 
227 227
     if ($company || $link) {
228
-      $queryBuilder->andWhere('PeopleLink.' . ($link ? 'people' : 'company') . ' IN(:people)');
228
+      $queryBuilder->andWhere('PeopleLink.'.($link ? 'people' : 'company').' IN(:people)');
229 229
       $queryBuilder->setParameter('people', preg_replace("/[^0-9]/", "", ($link ?: $company)));
230 230
     }
231 231
   }
232 232
   public function checkCompany($type, QueryBuilder $queryBuilder, $resourceClass = null, $applyTo = null, $rootAlias = null): void
233 233
   {
234
-    $companies   = $this->getMyCompanies();
235
-    $queryBuilder->andWhere(sprintf('%s.' . $type . ' IN(:companies)', $rootAlias, $rootAlias));
234
+    $companies = $this->getMyCompanies();
235
+    $queryBuilder->andWhere(sprintf('%s.'.$type.' IN(:companies)', $rootAlias, $rootAlias));
236 236
     $queryBuilder->setParameter('companies', $companies);
237 237
 
238 238
     if ($payer = $this->request->query->get('company', null)) {
239
-      $queryBuilder->andWhere(sprintf('%s.' . $type . ' IN(:people)', $rootAlias));
239
+      $queryBuilder->andWhere(sprintf('%s.'.$type.' IN(:people)', $rootAlias));
240 240
       $queryBuilder->setParameter('people', preg_replace("/[^0-9]/", "", $payer));
241 241
     }
242 242
   }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     $token = $this->security->getToken();
250 250
     if (!$token) return [];
251
-    $currentUser  =  $token->getUser();
251
+    $currentUser  = $token->getUser();
252 252
     $companies    = [];
253 253
     if (!$currentUser) return [];
254 254
 
Please login to merge, or discard this patch.