Skip to content

Commit 0fdfca8

Browse files
author
Aleksandr Startsev
committed
chore: Delete unnecessary impl generation
1 parent e3c2935 commit 0fdfca8

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

crates/macros/src/interface.rs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,43 +88,23 @@ impl ToTokens for InterfaceData<'_> {
8888
}
8989

9090
fn constructor() -> Option<::ext_php_rs::class::ConstructorMeta<Self>> {
91-
None
91+
use ::ext_php_rs::internal::class::PhpClassImpl;
92+
::ext_php_rs::internal::class::PhpClassImplCollector::<Self>::default().get_constructor()
9293
}
9394

9495
fn constants() -> &'static [(
9596
&'static str,
9697
&'static dyn ext_php_rs::convert::IntoZvalDyn,
9798
ext_php_rs::describe::DocComments,
9899
)] {
99-
use ::ext_php_rs::internal::class::PhpClassImpl;
100-
::ext_php_rs::internal::class::PhpClassImplCollector::<Self>::default().get_constants()
100+
&[#(#constants),*]
101101
}
102102

103103
fn get_properties<'a>() -> ::std::collections::HashMap<&'static str, ::ext_php_rs::internal::property::PropertyInfo<'a, Self>> {
104104
panic!("Non supported for Interface");
105105
}
106106
}
107107

108-
impl ::ext_php_rs::internal::class::PhpClassImpl<#path> for ::ext_php_rs::internal::class::PhpClassImplCollector<#path> {
109-
fn get_methods(self) -> ::std::vec::Vec<
110-
(::ext_php_rs::builders::FunctionBuilder<'static>, ::ext_php_rs::flags::MethodFlags)
111-
> {
112-
panic!("Non supported for Interface");
113-
}
114-
115-
fn get_method_props<'a>(self) -> ::std::collections::HashMap<&'static str, ::ext_php_rs::props::Property<'a, #path>> {
116-
panic!("Non supported for Interface");
117-
}
118-
119-
fn get_constructor(self) -> ::std::option::Option<::ext_php_rs::class::ConstructorMeta<#path>> {
120-
None
121-
}
122-
123-
fn get_constants(self) -> &'static [(&'static str, &'static dyn ::ext_php_rs::convert::IntoZvalDyn, &'static [&'static str])] {
124-
&[#(#constants),*]
125-
}
126-
}
127-
128108
impl<'a> ::ext_php_rs::convert::FromZendObject<'a> for &'a #interface_name {
129109
#[inline]
130110
fn from_zend_object(

0 commit comments

Comments
 (0)