@@ -1791,23 +1791,26 @@ public function getMemberProperties($stackPtr)
1791
1791
&& $ this ->tokens [$ ptr ]['code ' ] !== T_TRAIT )
1792
1792
) {
1793
1793
if (isset ($ this ->tokens [$ ptr ]) === true
1794
- && $ this ->tokens [$ ptr ]['code ' ] === T_INTERFACE
1794
+ && ($ this ->tokens [$ ptr ]['code ' ] === T_INTERFACE
1795
+ || $ this ->tokens [$ ptr ]['code ' ] === T_ENUM )
1795
1796
) {
1796
- // T_VARIABLEs in interfaces can actually be method arguments
1797
+ // T_VARIABLEs in interfaces/enums can actually be method arguments
1797
1798
// but they wont be seen as being inside the method because there
1798
1799
// are no scope openers and closers for abstract methods. If it is in
1799
1800
// parentheses, we can be pretty sure it is a method argument.
1800
1801
if (isset ($ this ->tokens [$ stackPtr ]['nested_parenthesis ' ]) === false
1801
1802
|| empty ($ this ->tokens [$ stackPtr ]['nested_parenthesis ' ]) === true
1802
1803
) {
1803
- $ error = 'Possible parse error: interfaces may not include member vars ' ;
1804
- $ this ->addWarning ($ error , $ stackPtr , 'Internal.ParseError.InterfaceHasMemberVar ' );
1804
+ $ error = 'Possible parse error: %ss may not include member vars ' ;
1805
+ $ code = sprintf ('Internal.ParseError.%sHasMemberVar ' , ucfirst ($ this ->tokens [$ ptr ]['content ' ]));
1806
+ $ data = [strtolower ($ this ->tokens [$ ptr ]['content ' ])];
1807
+ $ this ->addWarning ($ error , $ stackPtr , $ code , $ data );
1805
1808
return [];
1806
1809
}
1807
1810
} else {
1808
1811
throw new RuntimeException ('$stackPtr is not a class member var ' );
1809
1812
}
1810
- }
1813
+ }//end if
1811
1814
1812
1815
// Make sure it's not a method parameter.
1813
1816
if (empty ($ this ->tokens [$ stackPtr ]['nested_parenthesis ' ]) === false ) {
0 commit comments