From d917dee4a405e882007bf525516012ff9c9faf57 Mon Sep 17 00:00:00 2001 From: Halleck45 Date: Tue, 26 Aug 2014 13:25:15 +0200 Subject: [PATCH] bug in arguments aextractor --- src/Hal/Component/OOP/Extractor/MethodExtractor.php | 9 +++++++-- tests/Hal/Component/OOP/MethodExtractorTest.php | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Hal/Component/OOP/Extractor/MethodExtractor.php b/src/Hal/Component/OOP/Extractor/MethodExtractor.php index 9b8c1894..36f6b651 100644 --- a/src/Hal/Component/OOP/Extractor/MethodExtractor.php +++ b/src/Hal/Component/OOP/Extractor/MethodExtractor.php @@ -66,8 +66,13 @@ public function extract(&$n, TokenCollection $tokens) if(sizeof($elems, COUNT_NORMAL) == 1) { list($name, $type) = array_pad($elems, 2, null); } else { - list($type, $name) = array_pad($elems, 2, null); - + if('$' == $elems[0][0]) { + $name = $elems[0]; + $type = null; + $isRequired = false; + } else { + list($type, $name) = array_pad($elems, 2, null); + } } $argument = new ReflectedArgument($name, $type, $isRequired); diff --git a/tests/Hal/Component/OOP/MethodExtractorTest.php b/tests/Hal/Component/OOP/MethodExtractorTest.php index 229b4123..c1eb6658 100644 --- a/tests/Hal/Component/OOP/MethodExtractorTest.php +++ b/tests/Hal/Component/OOP/MethodExtractorTest.php @@ -150,6 +150,8 @@ public function provideCodeForNew() { array(array(), '