Skip to content

Commit

Permalink
Merge pull request #20 from eriksanders86/master
Browse files Browse the repository at this point in the history
Laravel 5.8 fix
  • Loading branch information
weotch authored Mar 12, 2019
2 parents fcfc302 + ce3ae0c commit d2cd16c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Cloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ protected function saveClone($clone, $relation = null, $src, $child = null) {

// Notify listeners via callback or event
if (method_exists($clone, 'onCloning')) $clone->onCloning($src, $child);
$this->events->fire('cloner::cloning: '.get_class($src), [$clone, $src]);
$this->events->dispatch('cloner::cloning: '.get_class($src), [$clone, $src]);

// Do the save
if ($relation) $relation->save($clone);
else $clone->save();

// Notify listeners via callback or event
if (method_exists($clone, 'onCloned')) $clone->onCloned($src);
$this->events->fire('cloner::cloned: '.get_class($src), [$clone, $src]);
$this->events->dispatch('cloner::cloned: '.get_class($src), [$clone, $src]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function initUpchuck() {
}

protected function mockEvents() {
return m::mock('Illuminate\Events\Dispatcher', [ 'fire' => null ]);
return m::mock('Illuminate\Events\Dispatcher', [ 'dispatch' => null ]);
}

// https://github.com/laracasts/TestDummy/blob/master/tests/FactoryTest.php#L18
Expand Down

0 comments on commit d2cd16c

Please sign in to comment.