@@ -1791,23 +1791,26 @@ public function getMemberProperties($stackPtr)
17911791 && $ this ->tokens [$ ptr ]['code ' ] !== T_TRAIT )
17921792 ) {
17931793 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 )
17951796 ) {
1796- // T_VARIABLEs in interfaces can actually be method arguments
1797+ // T_VARIABLEs in interfaces/enums can actually be method arguments
17971798 // but they wont be seen as being inside the method because there
17981799 // are no scope openers and closers for abstract methods. If it is in
17991800 // parentheses, we can be pretty sure it is a method argument.
18001801 if (isset ($ this ->tokens [$ stackPtr ]['nested_parenthesis ' ]) === false
18011802 || empty ($ this ->tokens [$ stackPtr ]['nested_parenthesis ' ]) === true
18021803 ) {
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 );
18051808 return [];
18061809 }
18071810 } else {
18081811 throw new RuntimeException ('$stackPtr is not a class member var ' );
18091812 }
1810- }
1813+ }//end if
18111814
18121815 // Make sure it's not a method parameter.
18131816 if (empty ($ this ->tokens [$ stackPtr ]['nested_parenthesis ' ]) === false ) {
0 commit comments