@@ -38,6 +38,7 @@ pub struct Method {
3838 pub optional : Option < String > ,
3939 pub output : Option < ( String , bool ) > ,
4040 pub _static : bool ,
41+ pub _abstract : bool ,
4142 pub visibility : Visibility ,
4243}
4344
@@ -81,6 +82,7 @@ pub fn parser(
8182 let mut visibility = Visibility :: Public ;
8283 let mut as_prop = None ;
8384 let mut identifier = None ;
85+ let mut is_abstract = false ;
8486 let mut is_constructor = false ;
8587 let docs = get_docs ( & input. attrs ) ;
8688
@@ -90,6 +92,7 @@ pub fn parser(
9092 ParsedAttribute :: Default ( list) => defaults = list,
9193 ParsedAttribute :: Optional ( name) => optional = Some ( name) ,
9294 ParsedAttribute :: Visibility ( vis) => visibility = vis,
95+ ParsedAttribute :: Abstract => is_abstract = true ,
9396 ParsedAttribute :: Rename ( ident) => identifier = Some ( ident) ,
9497 ParsedAttribute :: Property { prop_name, ty } => {
9598 if as_prop. is_some ( ) {
@@ -211,6 +214,7 @@ pub fn parser(
211214 optional,
212215 output : get_return_type ( struct_ty, & input. sig . output ) ?,
213216 _static : matches ! ( method_type, MethodType :: Static ) ,
217+ _abstract : is_abstract,
214218 visibility,
215219 } ;
216220
@@ -447,6 +451,10 @@ impl Method {
447451 flags. push ( quote ! { Static } ) ;
448452 }
449453
454+ if self . _abstract {
455+ flags. push ( quote ! { Abstract } ) ;
456+ }
457+
450458 flags
451459 . iter ( )
452460 . map ( |flag| quote ! { :: ext_php_rs:: flags:: MethodFlags :: #flag } )
0 commit comments