Skip to content
This repository
Browse code

Merge pull request #102 from iteman/fixing-reflectionmethod-isempty-e…

…rror

Fixing "Undefined offset" error in ReflectionMethod::isEmpty()
  • Loading branch information...
commit cb54c94f89a5e1f4098363e19ccfe624b3e5346f 2 parents dd7e1a8 + b233154
Marcello Duarte authored October 03, 2012

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  src/PHPSpec/Util/ReflectionMethod.php
4  src/PHPSpec/Util/ReflectionMethod.php
@@ -68,8 +68,8 @@ public function isEmpty()
68 68
             $this->_objectOrClassName,
69 69
             $this->_methodName
70 70
         );
71  
-        list(,$path,) = explode("\n", (string)$method);
72  
-        preg_match('/(@@ )(.*\.php)( )(\d+)(\D*)(\d+)/', $path, $matches);
  71
+        $methodString = explode("\n", (string)$method);
  72
+        preg_match('/(@@ )(.*\.php)( )(\d+)(\D*)(\d+)/', $methodString[ count($methodString) - 3 ], $matches);
73 73
         list ($path, $start, $end) = array(
74 74
             $matches[2], $matches[4], $matches[6]
75 75
         );

0 notes on commit cb54c94

Please sign in to comment.
Something went wrong with that request. Please try again.