Skip to content

Commit

Permalink
Use array get to minimise code
Browse files Browse the repository at this point in the history
  • Loading branch information
phroggyy committed Sep 3, 2015
1 parent aaafb4b commit 09102ec
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,13 +888,7 @@ public function morphTo($name = null, $type = null, $id = null)
*/
protected function getActualClassNameForMorph($class)
{
$morphMap = Relation::morphMap();

if (isset($morphMap[$class])) {
return $morphMap[$class];
}

return $class;
return array_get(Relation::morphMap(), $class, $class);
}

/**
Expand Down

0 comments on commit 09102ec

Please sign in to comment.