Skip to content

Commit

Permalink
Prefers View contract name() method (#15955)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored and taylorotwell committed Oct 17, 2016
1 parent 1b09c67 commit d3671a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/View/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ protected function parseClassEvent($class, $prefix)
*/
public function callComposer(ViewContract $view)
{
$this->events->fire('composing: '.$view->getName(), [$view]);
$this->events->fire('composing: '.$view->name(), [$view]);
}

/**
Expand All @@ -527,7 +527,7 @@ public function callComposer(ViewContract $view)
*/
public function callCreator(ViewContract $view)
{
$this->events->fire('creating: '.$view->getName(), [$view]);
$this->events->fire('creating: '.$view->name(), [$view]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/View/ViewFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function testCallComposerCallsProperEvent()
{
$factory = $this->getFactory();
$view = m::mock('Illuminate\View\View');
$view->shouldReceive('getName')->once()->andReturn('name');
$view->shouldReceive('name')->once()->andReturn('name');
$factory->getDispatcher()->shouldReceive('fire')->once()->with('composing: name', [$view]);

$factory->callComposer($view);
Expand Down

0 comments on commit d3671a9

Please sign in to comment.