@@ -54,6 +54,7 @@ impl ToTokens for InterfaceData<'_> {
54
54
let implements = & self . attrs . extends ;
55
55
let methods_sig = & self . methods ;
56
56
let path = & self . path ;
57
+ let constants = & self . constants ;
57
58
quote ! {
58
59
pub struct #interface_name;
59
60
@@ -89,6 +90,7 @@ impl ToTokens for InterfaceData<'_> {
89
90
fn constructor( ) -> Option <:: ext_php_rs:: class:: ConstructorMeta <Self >> {
90
91
None
91
92
}
93
+
92
94
fn constants( ) -> & ' static [ (
93
95
& ' static str ,
94
96
& ' static dyn ext_php_rs:: convert:: IntoZvalDyn ,
@@ -99,27 +101,27 @@ impl ToTokens for InterfaceData<'_> {
99
101
}
100
102
101
103
fn get_properties<' a>( ) -> :: std:: collections:: HashMap <& ' static str , :: ext_php_rs:: internal:: property:: PropertyInfo <' a, Self >> {
102
- :: std :: collections :: HashMap :: new ( )
104
+ panic! ( "Non supported for Interface" ) ;
103
105
}
104
106
}
105
107
106
108
impl :: ext_php_rs:: internal:: class:: PhpClassImpl <#path> for :: ext_php_rs:: internal:: class:: PhpClassImplCollector <#path> {
107
109
fn get_methods( self ) -> :: std:: vec:: Vec <
108
110
( :: ext_php_rs:: builders:: FunctionBuilder <' static >, :: ext_php_rs:: flags:: MethodFlags )
109
111
> {
110
- vec! [ ]
112
+ panic! ( "Non supported for Interface" ) ;
111
113
}
112
114
113
115
fn get_method_props<' a>( self ) -> :: std:: collections:: HashMap <& ' static str , :: ext_php_rs:: props:: Property <' a, #path>> {
114
- todo! ( )
116
+ panic! ( "Non supported for Interface" ) ;
115
117
}
116
118
117
119
fn get_constructor( self ) -> :: std:: option:: Option <:: ext_php_rs:: class:: ConstructorMeta <#path>> {
118
120
None
119
121
}
120
122
121
123
fn get_constants( self ) -> & ' static [ ( & ' static str , & ' static dyn :: ext_php_rs:: convert:: IntoZvalDyn , & ' static [ & ' static str ] ) ] {
122
- & [ ]
124
+ & [ # ( #constants ) , * ]
123
125
}
124
126
}
125
127
@@ -299,6 +301,7 @@ impl<'a> Parse<'a, Vec<FnBuilder>> for ItemTrait {
299
301
}
300
302
}
301
303
304
+ #[ derive( Debug ) ]
302
305
struct Constant < ' a > {
303
306
name : String ,
304
307
expr : & ' a Expr ,
@@ -311,7 +314,7 @@ impl ToTokens for Constant<'_> {
311
314
let expr = & self . expr ;
312
315
let docs = & self . docs ;
313
316
quote ! {
314
- ( #name, #expr, & [ #( #docs) , * ] )
317
+ ( #name, & #expr, & [ #( #docs) , * ] )
315
318
}
316
319
. to_tokens ( tokens) ;
317
320
}
0 commit comments