Skip to content

Commit

Permalink
Merge pull request #111 from Fender123/patch-1
Browse files Browse the repository at this point in the history
fixed PHP Warning in Illuminate/Database adapter
  • Loading branch information
davedevelopment authored Sep 3, 2016
2 parents f1fb572 + 0f3725a commit cd37044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Phpmig/Adapter/Illuminate/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function fetchAll()
$all = $this->adapter
->table($this->tableName)
->orderBy('version')
->get();
->get()->toArray();

return array_map(function($v) use($fetchMode) {

Expand Down Expand Up @@ -117,4 +117,4 @@ public function createSchema()
$table->string('version');
});
}
}
}

2 comments on commit cd37044

@micahaza
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the result is already an array it will cause nasty problems like this:
PHP Fatal error: Call to a member function toArray() on a non-object in .../vendor/davedevelopment/phpmig/src/Phpmig/Adapter/Illuminate/Database.php on line 47

@michael-mader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.