@@ -54,6 +54,7 @@ impl ToTokens for InterfaceData<'_> {
5454 let implements = & self . attrs . extends ;
5555 let methods_sig = & self . methods ;
5656 let path = & self . path ;
57+ let constants = & self . constants ;
5758 quote ! {
5859 pub struct #interface_name;
5960
@@ -89,6 +90,7 @@ impl ToTokens for InterfaceData<'_> {
8990 fn constructor( ) -> Option <:: ext_php_rs:: class:: ConstructorMeta <Self >> {
9091 None
9192 }
93+
9294 fn constants( ) -> & ' static [ (
9395 & ' static str ,
9496 & ' static dyn ext_php_rs:: convert:: IntoZvalDyn ,
@@ -99,27 +101,27 @@ impl ToTokens for InterfaceData<'_> {
99101 }
100102
101103 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" ) ;
103105 }
104106 }
105107
106108 impl :: ext_php_rs:: internal:: class:: PhpClassImpl <#path> for :: ext_php_rs:: internal:: class:: PhpClassImplCollector <#path> {
107109 fn get_methods( self ) -> :: std:: vec:: Vec <
108110 ( :: ext_php_rs:: builders:: FunctionBuilder <' static >, :: ext_php_rs:: flags:: MethodFlags )
109111 > {
110- vec! [ ]
112+ panic! ( "Non supported for Interface" ) ;
111113 }
112114
113115 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" ) ;
115117 }
116118
117119 fn get_constructor( self ) -> :: std:: option:: Option <:: ext_php_rs:: class:: ConstructorMeta <#path>> {
118120 None
119121 }
120122
121123 fn get_constants( self ) -> & ' static [ ( & ' static str , & ' static dyn :: ext_php_rs:: convert:: IntoZvalDyn , & ' static [ & ' static str ] ) ] {
122- & [ ]
124+ & [ # ( #constants ) , * ]
123125 }
124126 }
125127
@@ -299,6 +301,7 @@ impl<'a> Parse<'a, Vec<FnBuilder>> for ItemTrait {
299301 }
300302}
301303
304+ #[ derive( Debug ) ]
302305struct Constant < ' a > {
303306 name : String ,
304307 expr : & ' a Expr ,
@@ -311,7 +314,7 @@ impl ToTokens for Constant<'_> {
311314 let expr = & self . expr ;
312315 let docs = & self . docs ;
313316 quote ! {
314- ( #name, #expr, & [ #( #docs) , * ] )
317+ ( #name, & #expr, & [ #( #docs) , * ] )
315318 }
316319 . to_tokens ( tokens) ;
317320 }
0 commit comments