Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Coduo/PHPMatcher/Matcher/CallbackMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public function match($value, $pattern)
*/
public function canMatch($pattern)
{
return is_callable($pattern);
return is_object($pattern) && is_callable($pattern);
}
}
1 change: 1 addition & 0 deletions tests/Coduo/PHPMatcher/Matcher/CallbackMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function test_negative_can_match()
{
$matcher = new CallbackMatcher();
$this->assertFalse($matcher->canMatch(new \DateTime()));
$this->assertFalse($matcher->canMatch('SIN'));
}

function test_positive_matches()
Expand Down