Skip to content

Commit

Permalink
Fix #9. Put back get_called_class().
Browse files Browse the repository at this point in the history
  • Loading branch information
Yada Khov committed Nov 30, 2016
1 parent 9564305 commit 19b5f9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"require": {},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpunit/dbunit": "^2.0"
"phpunit/dbunit": "^2.0",
"illuminate/database": "^5.1"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions src/InsertOnDuplicateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public static function replace(array $data)
*/
public static function getTableName()
{
$class = static::class;
$class = get_called_class();

return $class::getTable();
return (new $class())->getTable();
}

/**
Expand All @@ -105,9 +105,9 @@ public static function getTableName()
*/
public static function getModelConnectionName()
{
$class = static::class;
$class = get_called_class();

return $class::getConnection();
return (new $class())->getConnection();
}

/**
Expand Down

0 comments on commit 19b5f9c

Please sign in to comment.