From b2331542699ea049f2cc50d55047dad5cd660d12 Mon Sep 17 00:00:00 2001 From: KUBO Atsuhiro Date: Thu, 27 Sep 2012 13:59:18 +0900 Subject: [PATCH] Fixed a defect that caused an error "Undefined offset: 2" to be raised in the ReflectionMethod::isEmpty() method. --- src/PHPSpec/Util/ReflectionMethod.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PHPSpec/Util/ReflectionMethod.php b/src/PHPSpec/Util/ReflectionMethod.php index f49ab41ec..ca2aa0772 100644 --- a/src/PHPSpec/Util/ReflectionMethod.php +++ b/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] );