Skip to content

Commit

Permalink
Refactor DatabaseHandler::finish().
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 20, 2016
1 parent b0f9621 commit a956d6a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/DatabaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ public function finish(array $items = [])
foreach ($items as $key => $value) {
$isNew = $this->isNewKey($key);

if (! is_null($value)) {
$value = serialize($value);
$serialized = serialize($value);

if (! $this->check($key, $value)) {
$changed = true;
if (! $this->check($key, $serialized)) {
$changed = true;

$this->save($key, $value, $isNew);
if (! is_null($value)) {
$this->save($key, $serialized, $isNew);
} else {
$this->delete($key);
}
} else {
$this->delete($key);
}
}

Expand Down

0 comments on commit a956d6a

Please sign in to comment.