1
- use darling:: util:: Flag ;
2
- use darling:: { FromAttributes , FromMeta , ToTokens } ;
1
+ use darling:: { FromAttributes } ;
3
2
use proc_macro2:: TokenStream ;
4
3
use quote:: { format_ident, quote} ;
5
- use syn:: { Attribute , Expr , Fields , ItemStruct , ItemTrait } ;
4
+ use syn:: { ItemTrait , TraitItem , TraitItemFn } ;
5
+ use crate :: helpers:: CleanPhpAttr ;
6
6
7
- use crate :: helpers:: get_docs;
8
7
use crate :: parsing:: { PhpRename , RenameRule } ;
9
8
use crate :: prelude:: * ;
10
9
@@ -21,6 +20,20 @@ pub fn parser(mut input: ItemTrait) -> Result<TokenStream> {
21
20
22
21
let interface_name = format_ident ! ( "PhpInterface{ident}" ) ;
23
22
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
+ } ;
24
37
25
38
Ok ( quote ! {
26
39
#input
@@ -66,7 +79,7 @@ pub fn parser(mut input: ItemTrait) -> Result<TokenStream> {
66
79
& [ ]
67
80
}
68
81
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 >> {
70
83
HashMap :: new( )
71
84
}
72
85
0 commit comments