1- use darling:: util:: Flag ;
2- use darling:: { FromAttributes , FromMeta , ToTokens } ;
1+ use darling:: { FromAttributes } ;
32use proc_macro2:: TokenStream ;
43use quote:: { format_ident, quote} ;
5- use syn:: { Attribute , Expr , Fields , ItemStruct , ItemTrait } ;
4+ use syn:: { ItemTrait , TraitItem , TraitItemFn } ;
5+ use crate :: helpers:: CleanPhpAttr ;
66
7- use crate :: helpers:: get_docs;
87use crate :: parsing:: { PhpRename , RenameRule } ;
98use crate :: prelude:: * ;
109
@@ -21,6 +20,20 @@ pub fn parser(mut input: ItemTrait) -> Result<TokenStream> {
2120
2221 let interface_name = format_ident ! ( "PhpInterface{ident}" ) ;
2322 let name = attr. rename . rename ( ident. to_string ( ) , RenameRule :: Pascal ) ;
23+ input. attrs . clean_php ( ) ;
24+
25+ let mut interface_methods: Vec < TraitItemFn > = Vec :: new ( ) ;
26+ for i in input. items . clone ( ) . into_iter ( ) {
27+ match i {
28+ TraitItem :: Fn ( f) => {
29+ if f. default . is_some ( ) {
30+ bail ! ( "Interface could not have default impl" ) ;
31+ }
32+ interface_methods. push ( f) ;
33+ }
34+ _ => { }
35+ }
36+ } ;
2437
2538 Ok ( quote ! {
2639 #input
@@ -66,7 +79,7 @@ pub fn parser(mut input: ItemTrait) -> Result<TokenStream> {
6679 & [ ]
6780 }
6881
69- fn get_properties<' a>( ) -> std:: collections:: HashMap <& ' static str , PropertyInfo <' a, Self >> {
82+ fn get_properties<' a>( ) -> std:: collections:: HashMap <& ' static str , :: ext_php_rs :: internal :: property :: PropertyInfo <' a, Self >> {
7083 HashMap :: new( )
7184 }
7285
0 commit comments