@@ -121,8 +121,9 @@ discard block |
||
121 | 121 | foreach($detailedReport->getData() as $timeEntry) { |
122 | 122 | $timeEntrySent = false; |
123 | 123 | |
124 | - if (in_array($timeEntry->getId(), $this->sentTimeEntries)) |
|
125 | - continue; |
|
124 | + if (in_array($timeEntry->getId(), $this->sentTimeEntries)) { |
|
125 | + continue; |
|
126 | + } |
|
126 | 127 | |
127 | 128 | // Log the entry if the client key exists |
128 | 129 | if ($this->timeEntryCanBeLoggedByConfig($this->clients, $timeEntry->getClient(), $timeEntrySent)) { |
@@ -180,8 +181,9 @@ discard block |
||
180 | 181 | $task->setTimeLog($this->buildTimeLog($entry)); |
181 | 182 | $task->setClientId($clients[$clientKey]); |
182 | 183 | |
183 | - if (isset($projects) && isset($projectKey)) |
|
184 | - $task->setProjectId($projects[$projectKey]); |
|
184 | + if (isset($projects) && isset($projectKey)) { |
|
185 | + $task->setProjectId($projects[$projectKey]); |
|
186 | + } |
|
185 | 187 | |
186 | 188 | $this->invoiceNinjaClient->saveNewTask($task); |
187 | 189 | } |
@@ -284,8 +286,9 @@ discard block |
||
284 | 286 | |
285 | 287 | foreach ($this->togglClients as $togglClient) |
286 | 288 | { |
287 | - if ($togglClient->getWid() == $workspaceId && $togglClient->getId() == $togglProject->getCid()) |
|
288 | - $project->setClientId($this->clients[$togglClient->getName()]); |
|
289 | + if ($togglClient->getWid() == $workspaceId && $togglClient->getId() == $togglProject->getCid()) { |
|
290 | + $project->setClientId($this->clients[$togglClient->getName()]); |
|
291 | + } |
|
289 | 292 | } |
290 | 293 | |
291 | 294 | $projects[$togglProject->getName()] = $this->invoiceNinjaClient->saveNewProject($project)->getId(); |
@@ -300,16 +303,19 @@ discard block |
||
300 | 303 | |
301 | 304 | private function retrieveSentTimeEntries() |
302 | 305 | { |
303 | - if (!file_exists($this->storageDir)) |
|
304 | - mkdir($this->storageDir, 0777, true); |
|
306 | + if (!file_exists($this->storageDir)) { |
|
307 | + mkdir($this->storageDir, 0777, true); |
|
308 | + } |
|
305 | 309 | |
306 | - if (!file_exists($this->storageDir . $this->storageFileName)) |
|
307 | - touch($this->storageDir . $this->storageFileName); |
|
310 | + if (!file_exists($this->storageDir . $this->storageFileName)) { |
|
311 | + touch($this->storageDir . $this->storageFileName); |
|
312 | + } |
|
308 | 313 | |
309 | 314 | $this->sentTimeEntries = unserialize(file_get_contents($this->storageDir . $this->storageFileName)); |
310 | 315 | |
311 | - if (!is_array($this->sentTimeEntries)) |
|
312 | - $this->sentTimeEntries = Array(); |
|
316 | + if (!is_array($this->sentTimeEntries)) { |
|
317 | + $this->sentTimeEntries = Array(); |
|
318 | + } |
|
313 | 319 | |
314 | 320 | return $this->sentTimeEntries; |
315 | 321 | } |