Skip to content

Commit

Permalink
Rename to with to apply Context
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jul 19, 2019
1 parent fc0353f commit dd899a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ContextAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function _bindContext(ContextAware $to)
*
* @return ContextAware
*/
protected function _withContext(ContextAware $to)
protected function _applyContext(ContextAware $to)
{
$to->setContext($this->getContext());
return $to;
Expand Down
2 changes: 1 addition & 1 deletion tests/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testContextAware()
$this->assertSame($ctx, $obj->getContext());

$obj3 = new TestContextAwareObject();
$obj4 = $obj2->with($obj3);
$obj4 = $obj2->apply($obj3);
$this->assertTrue($obj3->hasContext());
$this->assertSame($ctx, $obj3->getContext());
$this->assertSame($obj3, $obj4);
Expand Down
4 changes: 2 additions & 2 deletions tests/Supporting/TestContextAwareObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function bind(ContextAware $to)
return $this->_bindContext($to);
}

public function with(ContextAware $to)
public function apply(ContextAware $to)
{
return $this->_withContext($to);
return $this->_applyContext($to);
}
}

0 comments on commit dd899a5

Please sign in to comment.