Passed
Pull Request — master (#4)
by
unknown
01:45
created
src/Syncer/Command/SyncTimings.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $this->clients = array_merge($this->clients, $this->retrieveClientsForWorkspace($workspace->getId()));
119 119
             $this->projects = array_merge($this->projects, $this->retrieveProjectsForWorkspace($workspace->getId()));
120 120
 
121
-            foreach($detailedReport->getData() as $timeEntry) {
121
+            foreach ($detailedReport->getData() as $timeEntry) {
122 122
                 $timeEntrySent = false;
123 123
 
124 124
                 if (in_array($timeEntry->getId(), $this->sentTimeEntries))
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 if ($this->timeEntryCanBeLoggedByConfig($this->clients, $timeEntry->getClient(), $timeEntrySent)) {
129 129
                     $this->logTask($timeEntry, $this->clients, $timeEntry->getClient(), $this->projects, $timeEntry->getProject());
130 130
 
131
-                    $this->sentTimeEntries[] = $timeEntry->getId();
131
+                    $this->sentTimeEntries[ ] = $timeEntry->getId();
132 132
                     $timeEntrySent = true;
133 133
                 }
134 134
 
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
                 if ($this->timeEntryCanBeLoggedByConfig($this->projects, $timeEntry->getProject(), $timeEntrySent)) {
137 137
                     $this->logTask($timeEntry, $this->projects, $timeEntry->getProject());
138 138
 
139
-                    $this->sentTimeEntries[] = $timeEntry->getId();
139
+                    $this->sentTimeEntries[ ] = $timeEntry->getId();
140 140
                     $timeEntrySent = true;
141 141
                 }
142 142
 
143 143
                 if ($timeEntrySent) {
144
-                    $this->io->success('TimeEntry ('. $timeEntry->getDescription() . ') sent to InvoiceNinja');
144
+                    $this->io->success('TimeEntry (' . $timeEntry->getDescription() . ') sent to InvoiceNinja');
145 145
                 }
146 146
             }
147 147
         }
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 
179 179
         $task->setDescription($this->buildTaskDescription($entry));
180 180
         $task->setTimeLog($this->buildTimeLog($entry));
181
-        $task->setClientId($clients[$clientKey]);
181
+        $task->setClientId($clients[ $clientKey ]);
182 182
 
183 183
         if (isset($projects) && isset($projectKey))
184
-            $task->setProjectId($projects[$projectKey]);
184
+            $task->setProjectId($projects[ $projectKey ]);
185 185
 
186 186
         $this->invoiceNinjaClient->saveNewTask($task);
187 187
     }
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
      */
212 212
     private function buildTimeLog(TimeEntry $entry): string
213 213
     {
214
-        $timeLog = [[
214
+        $timeLog = [ [
215 215
             $entry->getStart()->getTimestamp(),
216 216
             $entry->getEnd()->getTimestamp(),
217
-        ]];
217
+        ] ];
218 218
 
219 219
         return \GuzzleHttp\json_encode($timeLog);
220 220
     }
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 
229 229
         foreach ($this->togglClients as $togglClient)
230 230
         {
231
-            if (!isset($this->projects[$togglProject->getName()]))
231
+            if (!isset($this->projects[ $togglProject->getName() ]))
232 232
             {
233 233
                 $found = false;
234 234
                     foreach ($invoiceNinjaClients as $invoiceNinjaClient)
235 235
                     {
236 236
                         if ($invoiceNinjaClient->getIsDeleted() == false && strcasecmp($togglClient->getName(), $invoiceNinjaClient->getName()) == 0)
237 237
                         {
238
-                            $clients[$invoiceNinjaClient->getName()] = $invoiceNinjaClient->getId();
238
+                            $clients[ $invoiceNinjaClient->getName() ] = $invoiceNinjaClient->getId();
239 239
                             $found = true;
240 240
                         }
241 241
                     }
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 
247 247
                     $client->setName($togglClient->getName());
248 248
 
249
-                    $clients[$togglClient->getName()] = $this->invoiceNinjaClient->saveNewClient($client)->getId();
249
+                    $clients[ $togglClient->getName() ] = $this->invoiceNinjaClient->saveNewClient($client)->getId();
250 250
 
251
-                    $this->io->success('Client ('. $togglClient->getName() . ') created in InvoiceNinja');
251
+                    $this->io->success('Client (' . $togglClient->getName() . ') created in InvoiceNinja');
252 252
                 }
253 253
             }
254 254
         }
@@ -265,14 +265,14 @@  discard block
 block discarded – undo
265 265
 
266 266
         foreach ($togglProjects as $togglProject)
267 267
         {
268
-            if (!isset($this->projects[$togglProject->getName()]))
268
+            if (!isset($this->projects[ $togglProject->getName() ]))
269 269
             {
270 270
                 $found = false;
271 271
                 foreach ($invoiceNinjaProjects as $invoiceNinjaProject)
272 272
                 {
273 273
                     if ($invoiceNinjaProject->getIsDeleted() == false && strcasecmp($togglProject->getName(), $invoiceNinjaProject->getName()) == 0)
274 274
                     {
275
-                        $projects[$invoiceNinjaProject->getName()] = $invoiceNinjaProject->getId();
275
+                        $projects[ $invoiceNinjaProject->getName() ] = $invoiceNinjaProject->getId();
276 276
                         $found = true;
277 277
                     }
278 278
                 }
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
                     foreach ($this->togglClients as $togglClient)
286 286
                     {
287 287
                         if ($togglClient->getWid() == $workspaceId && $togglClient->getId() == $togglProject->getCid())
288
-                            $project->setClientId($this->clients[$togglClient->getName()]);
288
+                            $project->setClientId($this->clients[ $togglClient->getName() ]);
289 289
                     }
290 290
 
291
-                    $projects[$togglProject->getName()] = $this->invoiceNinjaClient->saveNewProject($project)->getId();
291
+                    $projects[ $togglProject->getName() ] = $this->invoiceNinjaClient->saveNewProject($project)->getId();
292 292
 
293
-                    $this->io->success('Project ('. $togglProject->getName() . ') created in InvoiceNinja');
293
+                    $this->io->success('Project (' . $togglProject->getName() . ') created in InvoiceNinja');
294 294
                 }
295 295
             }
296 296
         }
Please login to merge, or discard this patch.
src/Syncer/Toggl/TogglClient.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function getWorkspaces()
51 51
     {
52 52
         $response = $this->client->request('GET', self::VERSION . '/workspaces', [
53
-            'auth' => [$this->api_key, 'api_token'],
53
+            'auth' => [ $this->api_key, 'api_token' ],
54 54
         ]);
55 55
 
56 56
         return $this->serializer->deserialize($response->getBody(), 'array<Syncer\Dto\Toggl\Workspace>', 'json');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function getClientsForWorkspace($workspaceId)
63 63
     {
64 64
         $response = $this->client->request('GET', self::VERSION . '/workspaces/' . $workspaceId . '/clients', [
65
-            'auth' => [$this->api_key, 'api_token'],
65
+            'auth' => [ $this->api_key, 'api_token' ],
66 66
         ]);
67 67
 
68 68
         return $this->serializer->deserialize($response->getBody(), 'array<Syncer\Dto\Toggl\Client>', 'json');
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     public function getProjectsForWorkspace($workspaceId)
75 75
     {
76 76
         $response = $this->client->request('GET', self::VERSION . '/workspaces/' . $workspaceId . '/projects', [
77
-            'auth' => [$this->api_key, 'api_token'],
77
+            'auth' => [ $this->api_key, 'api_token' ],
78 78
         ]);
79 79
 
80 80
         return $this->serializer->deserialize($response->getBody(), 'array<Syncer\Dto\Toggl\Project>', 'json');
Please login to merge, or discard this patch.