File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -238,16 +238,23 @@ impl ClassBuilder {
238238 "Class name in builder does not match class name in `impl RegisteredClass`."
239239 ) ;
240240 self . object_override = Some ( create_object :: < T > ) ;
241+
242+ let mut func = if T :: FLAGS . contains ( ClassFlags :: Interface ) {
243+ FunctionBuilder :: new_abstract ( "__construct" )
244+ } else {
245+ FunctionBuilder :: new ( "__construct" , constructor :: < T > )
246+ } ;
247+
241248 self . method (
242249 {
243- let mut func = FunctionBuilder :: new ( "__construct" , constructor :: < T > ) ;
244250 if let Some ( ConstructorMeta { build_fn, .. } ) = T :: constructor ( ) {
245251 func = build_fn ( func) ;
246252 }
247253 func
248254 } ,
249255 MethodFlags :: Public ,
250256 )
257+
251258 }
252259
253260 /// Function to register the class with PHP. This function is called after
You can’t perform that action at this time.
0 commit comments