Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
changed exception to type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
wryck7 committed Mar 13, 2013
1 parent e160053 commit 124b138
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Identical.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,13 @@ public function setLiteral($literal)
* @return bool
* @throws Exception\RuntimeException if the token doesn't exist in the context array
*/
public function isValid($value, $context = null)
public function isValid($value, array $context = null)
{
$this->setValue($value);

$token = $this->getToken();

if (!$this->getLiteral() && $context !== null) {
if (!is_array($context)) {
throw new Exception\InvalidArgumentException(sprintf(
'Context passed to %s must be an array or null; received "%s"',
__METHOD__,
(is_object($context) ? get_class($context) : gettype($context))
));
}

if (is_array($token)) {
while (is_array($token)){
$key = key($token);
Expand Down

0 comments on commit 124b138

Please sign in to comment.