Passed
Push — master ( 28aa0e...0fd630 )
by Luiz Kim
02:32
created
src/Controller/DeleteUserAction.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,9 @@
 block discarded – undo
113 113
 
114 114
             return true;
115 115
         } catch (\Exception $e) {
116
-            if ($this->manager->getConnection()->isTransactionActive())
117
-                $this->manager->getConnection()->rollBack();
116
+            if ($this->manager->getConnection()->isTransactionActive()) {
117
+                            $this->manager->getConnection()->rollBack();
118
+            }
118 119
 
119 120
             throw new \InvalidArgumentException($e->getMessage());
120 121
         }
Please login to merge, or discard this patch.
src/Repository/PeopleRepository.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@
 block discarded – undo
51 51
             ->setParameter('company', $company->getId())
52 52
             ->setParameter('people', $people->getId());
53 53
 
54
-        if ($linkType)
55
-            $queryBuilder->setParameter('linkType', $linkType)->andWhere('pl.link_type = :linkType');
54
+        if ($linkType) {
55
+                    $queryBuilder->setParameter('linkType', $linkType)->andWhere('pl.link_type = :linkType');
56
+        }
56 57
 
57 58
         if ($maxResults) {
58 59
             $queryBuilder->setMaxResults($maxResults);
Please login to merge, or discard this patch.
src/Service/PeopleService.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
   {
39 39
 
40 40
     $document = $this->manager->getRepository(Document::class)->findOneBy(['document' => $document_number]);
41
-    if ($document)
42
-      return $document->getPeople();
41
+    if ($document) {
42
+          return $document->getPeople();
43
+    }
43 44
 
44 45
 
45 46
     if ($name) {
@@ -71,9 +72,9 @@  discard block
 block discarded – undo
71 72
     $payload   = json_decode($request->getContent());
72 73
     if (isset($payload->link_type)) {
73 74
       $company = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->company));
74
-      if ($company)
75
-        $this->addLink($company, $people, $payload->link_type);
76
-      else {
75
+      if ($company) {
76
+              $this->addLink($company, $people, $payload->link_type);
77
+      } else {
77 78
         $link = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->link));
78 79
         if ($payload->link_type == 'employee' && $link) {
79 80
           $this->addLink($people, $link, $payload->link_type);
@@ -101,8 +102,9 @@  discard block
 block discarded – undo
101 102
       'link_type' => $link_type
102 103
     ]);
103 104
 
104
-    if (!$peopleLink)
105
-      $peopleLink = new PeopleLink();
105
+    if (!$peopleLink) {
106
+          $peopleLink = new PeopleLink();
107
+    }
106 108
 
107 109
     $peopleLink->setCompany($company);
108 110
     $peopleLink->setPeople($people);
@@ -157,8 +159,9 @@  discard block
 block discarded – undo
157 159
      */
158 160
     $currentUser  = $this->security->getUser();
159 161
     $companies    = [];
160
-    if (!$currentUser)
161
-      return [];
162
+    if (!$currentUser) {
163
+          return [];
164
+    }
162 165
 
163 166
     if (!$currentUser->getPeople()->getLink()->isEmpty()) {
164 167
       foreach ($currentUser->getPeople()->getLink() as $company) {
Please login to merge, or discard this patch.
src/Service/PeopleRoleService.php 1 patch
Braces   +21 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@  discard block
 block discarded – undo
34 34
      */
35 35
     foreach ($getPeopleCompanies as $peopleCompany) {
36 36
       $isFranchisee = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $peopleCompany->getCompany(), 'franchisee', 1);
37
-      if ($isFranchisee) return true;
37
+      if ($isFranchisee) {
38
+       return true;
39
+      }
38 40
     }
39 41
     return $isFranchisee;
40 42
   }
@@ -46,7 +48,9 @@  discard block
 block discarded – undo
46 48
     $isSalesman = false;
47 49
 
48 50
     $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1);
49
-    if ($isSalesman) return true;
51
+    if ($isSalesman) {
52
+     return true;
53
+    }
50 54
 
51 55
     $getPeopleCompanies = $this->manager->getRepository(PeopleLink::class)->findBy([
52 56
       'people' => $people,
@@ -57,7 +61,9 @@  discard block
 block discarded – undo
57 61
      */
58 62
     foreach ($getPeopleCompanies as $peopleCompany) {
59 63
       $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $peopleCompany->getCompany(), 'salesman', 1);
60
-      if ($isSalesman) return true;
64
+      if ($isSalesman) {
65
+       return true;
66
+      }
61 67
     }
62 68
     return $isSalesman;
63 69
   }
@@ -69,8 +75,9 @@  discard block
 block discarded – undo
69 75
     $mainCompany = $this->getMainCompany();
70 76
 
71 77
     $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1);
72
-    if ($isSuper)
73
-      $peopleRole[] = 'super';
78
+    if ($isSuper) {
79
+          $peopleRole[] = 'super';
80
+    }
74 81
 
75 82
 
76 83
 
@@ -81,13 +88,15 @@  discard block
 block discarded – undo
81 88
     }
82 89
 
83 90
     $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1);
84
-    if ($isClient)
85
-      $peopleRole[] = 'client';
91
+    if ($isClient) {
92
+          $peopleRole[] = 'client';
93
+    }
86 94
 
87 95
 
88 96
     $isSalesman = $this->isSalesman($people);
89
-    if ($isSalesman)
90
-      $peopleRole[] = 'salesman';
97
+    if ($isSalesman) {
98
+          $peopleRole[] = 'salesman';
99
+    }
91 100
 
92 101
 
93 102
     return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole));
@@ -101,7 +110,9 @@  discard block
 block discarded – undo
101 110
   public function getMainCompany(): People
102 111
   {
103 112
 
104
-    if (self::$mainCompany) return self::$mainCompany;
113
+    if (self::$mainCompany) {
114
+     return self::$mainCompany;
115
+    }
105 116
 
106 117
     $peopleDomain = $this->domainService->getPeopleDomain();
107 118
     self::$mainCompany =  $peopleDomain->getPeople();
Please login to merge, or discard this patch.