Skip to content

Commit

Permalink
fix context manager bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Jan 19, 2019
1 parent 90aca5b commit 4153e91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Context/ContextManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ContextManager

private $deferList = [];

public function registerContextHandler($key, ContextHandlerInterface $handler):ContextManager
public function registerItemHandler($key, ContextHandlerInterface $handler):ContextManager
{
$this->contextHandler[$key] = $handler;
return $this;
Expand All @@ -32,7 +32,7 @@ public function registerContextHandler($key, ContextHandlerInterface $handler):C
public function set($key,$value,$cid = null):ContextManager
{
if(isset($this->contextHandler[$key])){
throw new ModifyError('key is already been register for context handler');
throw new ModifyError('key is already been register for context item handler');
}
$cid = $this->getCid($cid);
$this->context[$cid][$key] = $value;
Expand Down
2 changes: 1 addition & 1 deletion tests/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ContextTest extends TestCase
{
function __construct(?string $name = null, array $data = [], string $dataName = '')
{
ContextManager::getInstance()->registerContextHandler('handler',new ContextContextHandler());
ContextManager::getInstance()->registerItemHandler('handler',new ContextContextHandler());
parent::__construct($name, $data, $dataName);
}

Expand Down

0 comments on commit 4153e91

Please sign in to comment.