FIX Parsing docblock comments in ConfigStaticManifest

This commit is contained in:
Hamish Friedlander 2013-03-13 11:59:49 +13:00
parent 60b72edfba
commit 53595dc930
2 changed files with 13 additions and 1 deletions

View File

@ -268,7 +268,7 @@ class SS_ConfigStaticManifest_Parser {
else if($type == ';' || $type == ',' || $type == '=') {
break;
}
else if($type == T_COMMENT) {
else if($type == T_COMMENT || $type == T_DOC_COMMENT) {
// NOP
}
else {

View File

@ -57,6 +57,14 @@ DOC;
static /* Has comment inline */ $commented_int = 1, /* And here */ $commented_string = 'string';
static
/**
* Has docblock inline
*/
$docblocked_int = 1,
/** And here */
$docblocked_string = 'string';
// Should ignore static methpds
static function static_method() {}
@ -136,8 +144,12 @@ DOC;
public function testIgnoreComments() {
$statics = $this->parseSelf()->getStatics();
$this->assertEquals(self::$commented_int, $statics[__CLASS__]['commented_int']['value']);
$this->assertEquals(self::$commented_string, $statics[__CLASS__]['commented_string']['value']);
$this->assertEquals(self::$docblocked_int, $statics[__CLASS__]['docblocked_int']['value']);
$this->assertEquals(self::$docblocked_string, $statics[__CLASS__]['docblocked_string']['value']);
}
public function testIgnoresMethodStatics() {