mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-06-29 16:09:23 +02:00
FIX Parsing docblock comments in ConfigStaticManifest
This commit is contained in:
parent
60b72edfba
commit
53595dc930
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user