Skip to content

Commit

Permalink
Fixed a defect that caused an error "Undefined offset: 2" to be raise…
Browse files Browse the repository at this point in the history
…d in the ReflectionMethod::isEmpty() method.
  • Loading branch information
iteman committed Sep 27, 2012
1 parent dd7e1a8 commit b233154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PHPSpec/Util/ReflectionMethod.php
Expand Up @@ -68,8 +68,8 @@ public function isEmpty()
$this->_objectOrClassName,
$this->_methodName
);
list(,$path,) = explode("\n", (string)$method);
preg_match('/(@@ )(.*\.php)( )(\d+)(\D*)(\d+)/', $path, $matches);
$methodString = explode("\n", (string)$method);
preg_match('/(@@ )(.*\.php)( )(\d+)(\D*)(\d+)/', $methodString[ count($methodString) - 3 ], $matches);
list ($path, $start, $end) = array(
$matches[2], $matches[4], $matches[6]
);
Expand Down

0 comments on commit b233154

Please sign in to comment.