Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
feat(case-insensitive operator) handle cast to lower on public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierozi committed Mar 16, 2017
1 parent e6bea82 commit e54b7ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Visitor/Asserter.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public function setOperator($operator, $callable)
*/
public function operatorExists($operator)
{
return true === array_key_exists($operator, $this->_operators);
return true === array_key_exists(mb_strtolower($operator), $this->_operators);
}

/**
Expand All @@ -493,6 +493,8 @@ public function getOperator($operator)
return null;
}

$operator = mb_strtolower($operator);

$handle = &$this->_operators[$operator];

if (!($handle instanceof Consistency\Xcallable)) {
Expand Down

0 comments on commit e54b7ef

Please sign in to comment.