Skip to content

Commit

Permalink
Merge pull request #1 from Luceos/master
Browse files Browse the repository at this point in the history
removed trailing ; and checking for fresh object
  • Loading branch information
mpociot authored Jun 20, 2016
2 parents 0f7d9ba + a4c14e3 commit c7b172b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Mpociot/Firebase/SyncsWithFirebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ protected function saveToFirebase($mode)
}
$path = $this->getTable() . '/' . $this->getKey();

if ($mode === 'set') {
$this->firebaseClient->set($path, $this->fresh()->toArray());
} elseif ($mode === 'update') {
;
$this->firebaseClient->update($path, $this->fresh()->toArray());
if ($mode === 'set' && $fresh = $this->fresh()) {
$this->firebaseClient->set($path, $fresh->toArray());
} elseif ($mode === 'update' && $fresh = $this->fresh()) {
$this->firebaseClient->update($path, $fresh->toArray());
} elseif ($mode === 'delete') {
$this->firebaseClient->delete($path);
}
Expand Down

0 comments on commit c7b172b

Please sign in to comment.