Skip to content

Commit

Permalink
rename to dispatchesEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 2, 2017
1 parent b6472bf commit 3dbe12f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait HasEvents
*
* @var array
*/
protected $shouldFire = [];
protected $dispatchesEvents = [];

/**
* User exposed observable events.
Expand Down Expand Up @@ -156,11 +156,11 @@ protected function fireModelEvent($event, $halt = true)
*/
protected function fireCustomModelEvent($event, $method)
{
if (! isset($this->shouldFire[$event])) {
if (! isset($this->dispatchesEvents[$event])) {
return;
}

$result = static::$dispatcher->$method(new $this->shouldFire[$event]($this));
$result = static::$dispatcher->$method(new $this->dispatchesEvents[$event]($this));

if (! is_null($result)) {
return $result;
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseEloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ class EloquentModelSavingEventStub

class EloquentModelEventObjectStub extends \Illuminate\Database\Eloquent\Model
{
protected $shouldFire = [
protected $dispatchesEvents = [
'saving' => EloquentModelSavingEventStub::class,
];
}

0 comments on commit 3dbe12f

Please sign in to comment.