Passed
Push — master ( be26c9...87f8af )
by Luiz Kim
02:08
created
src/Service/PeopleRoleService.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
    *
31 31
    * @var PeopleService
32 32
    */
33
-  private $people  = null;
33
+  private $people = null;
34 34
 
35 35
   public function __construct(
36 36
     EntityManagerInterface $entityManager,
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
       }
76 76
     }
77 77
 
78
-    $myCompany  = $peopleCompany->getCompany();
78
+    $myCompany = $peopleCompany->getCompany();
79 79
     return $this->getAllRolesByCompany($people, $myCompany);
80 80
   }
81 81
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     if ($company->getId() == $mainCompany->getId()) {
88 88
       $isSuper = $mainCompany->getCompany()
89 89
         ->exists(
90
-          function ($key, PeopleLink $peopleLink) use ($people) {
90
+          function($key, PeopleLink $peopleLink) use ($people) {
91 91
             return $peopleLink->getPeople()->getId() === $people->getId();
92 92
           }
93 93
         );
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 
102 102
     $isFranchisee = $mainCompany->getCompany()
103 103
       ->exists(
104
-        function ($key, PeopleLink $peopleFranchisee) use ($people, $company) {
104
+        function($key, PeopleLink $peopleFranchisee) use ($people, $company) {
105 105
           foreach ($peopleFranchisee->getCompany() as $peopleLink) {
106
-            if ($peopleLink->getCompany()->getId() == $company->getId() &&  $peopleLink->getPeople()->getId() === $people->getId()) {
106
+            if ($peopleLink->getCompany()->getId() == $company->getId() && $peopleLink->getPeople()->getId() === $people->getId()) {
107 107
               return  true;
108 108
             }
109 109
           }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
     $isClient = $company->getCompany()
119 119
       ->exists(
120
-        function ($key, PeopleLink $peopleLink) use ($people) {
120
+        function($key, PeopleLink $peopleLink) use ($people) {
121 121
           return $peopleLink->getPeople()->getId() === $people->getId();
122 122
         }
123 123
       );
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
     $isClient = $people->getLink()
131 131
       ->exists(
132
-        function ($key, PeopleLink $peopleLink) use ($company) {
132
+        function($key, PeopleLink $peopleLink) use ($company) {
133 133
           return $this->manager->getRepository(PeopleClient::class)->findOneBy(
134 134
             [
135 135
               'client' => $peopleLink->getCompany(),
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
     $isSalesman = $company->getPeopleSalesman()
148 148
       ->exists(
149
-        function ($key, PeopleSalesman $peopleSalesman) use ($people) {
149
+        function($key, PeopleSalesman $peopleSalesman) use ($people) {
150 150
           return $peopleSalesman->getSalesman()->getId() === $people->getId();
151 151
         }
152 152
       );
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,10 +168,11 @@
 block discarded – undo
168 168
     $domain  = $_SERVER['HTTP_HOST'];
169 169
     $company = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]);
170 170
 
171
-    if ($company === null)
172
-      throw new \Exception(
171
+    if ($company === null) {
172
+          throw new \Exception(
173 173
         sprintf('Main company "%s" not found', $domain)
174 174
       );
175
+    }
175 176
 
176 177
     return $company->getPeople();
177 178
   }
Please login to merge, or discard this patch.