From dd899a528320e0c99cdbc6dded2517f1a54d4128 Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Fri, 19 Jul 2019 16:17:31 +0100 Subject: [PATCH] Rename to with to apply Context --- src/ContextAwareTrait.php | 2 +- tests/ContextTest.php | 2 +- tests/Supporting/TestContextAwareObject.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ContextAwareTrait.php b/src/ContextAwareTrait.php index 1ba1359..b04cad6 100644 --- a/src/ContextAwareTrait.php +++ b/src/ContextAwareTrait.php @@ -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; diff --git a/tests/ContextTest.php b/tests/ContextTest.php index 02f91c5..953d13f 100644 --- a/tests/ContextTest.php +++ b/tests/ContextTest.php @@ -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); diff --git a/tests/Supporting/TestContextAwareObject.php b/tests/Supporting/TestContextAwareObject.php index 0d2e4f4..402c2f4 100644 --- a/tests/Supporting/TestContextAwareObject.php +++ b/tests/Supporting/TestContextAwareObject.php @@ -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); } }