Skip to content

Commit

Permalink
Bring toArray back tro Result
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrala committed Jun 14, 2016
1 parent dff4ceb commit 1c85661
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Inspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function handle()
array_walk(
$inspectedRepository['results'],
function (&$row) {
$row = (array)$row;
$row = $row->toArray();
}
);

Expand Down
15 changes: 14 additions & 1 deletion src/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,20 @@ public function getDate()

public function __toString()
{
return json_encode((array)$this);
return json_encode($this->toArray());
}

public function toArray()
{
return [
'filename' => $this->filename,
'line' => $this->line,
'author' => $this->author,
'email' => $this->email,
'date' => $this->date,
'commitHash' => $this->commitHash,
'parser' => $this->parser,
];
}

/**
Expand Down

0 comments on commit 1c85661

Please sign in to comment.