Skip to content

Commit

Permalink
[gh-17] Fixed another PHP 5.3.2 related bug preventing matcher being …
Browse files Browse the repository at this point in the history
…used as callbacks
  • Loading branch information
MarcelloDuarte committed May 1, 2011
1 parent 5f15851 commit b6b290c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/PHPSpec/Specification.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,15 @@ public function setRunner($runner)
*/
protected function _createMatcher($method)
{
$matcherClass = "\\PHPSpec\\Matcher\\" . ucfirst($method);
$matcherClass = ucfirst($method);
try {
if (class_exists($matcherClass, true)) {
$this->_matcher = new $matcherClass($this->getExpectedValue());
}
} catch (\PHPSpec\Exception $e) {
$matcherClass = "\\PHPSpec\\Context\\Zend\\Matcher\\" .
ucfirst($method);
$this->_matcher = new $matcherClass($this->getExpectedValue());
$factory = '$this->_matcher = new \PHPSpec\Matcher\\' .
$matcherClass . '($this->getExpectedValue());';
eval($factory);
} catch(\PHPSpec\Exception $e) {
$factory = '$this->_matcher = new \PHPSpec\Context\Zend\Matcher\\' .
$matcherClass . '($this->getExpectedValue());';
eval($factory);
}
}

Expand Down

0 comments on commit b6b290c

Please sign in to comment.