Permalink
Browse files

Fixed a defect that caused an error "Undefined offset: 2" to be raise…

…d in the ReflectionMethod::isEmpty() method.
  • Loading branch information...
1 parent dd7e1a8 commit b2331542699ea049f2cc50d55047dad5cd660d12 @iteman iteman committed Sep 27, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/PHPSpec/Util/ReflectionMethod.php
@@ -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]
);

0 comments on commit b233154

Please sign in to comment.