Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX Parsing docblock comments in ConfigStaticManifest

  • Loading branch information...
commit 53595dc930ea0505ca822a571c3f81218bb860b3 1 parent 60b72ed
@hafriedlander hafriedlander authored
View
2  core/manifest/ConfigStaticManifest.php
@@ -268,7 +268,7 @@ function parseStatic($access, $class) {
else if($type == ';' || $type == ',' || $type == '=') {
break;
}
- else if($type == T_COMMENT) {
+ else if($type == T_COMMENT || $type == T_DOC_COMMENT) {
// NOP
}
else {
View
12 tests/core/manifest/ConfigStaticManifestTest.php
@@ -57,6 +57,14 @@ class ConfigStaticManifestTest extends SapphireTest {
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 @@ public function testParsingValues() {
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() {
Please sign in to comment.
Something went wrong with that request. Please try again.