File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ impl ClassBuilder {
8585 /// * `func` - The function entry to add to the class.
8686 /// * `flags` - Flags relating to the function. See [`MethodFlags`].
8787 pub fn method ( mut self , mut func : FunctionEntry , flags : MethodFlags ) -> Self {
88- func. flags = flags. bits ( ) ;
88+ func. flags | = flags. bits ( ) ;
8989 self . methods . push ( func) ;
9090 self
9191 }
Original file line number Diff line number Diff line change 11use crate :: {
22 args:: { Arg , ArgInfo } ,
33 error:: { Error , Result } ,
4- flags:: DataType ,
4+ flags:: { DataType , MethodFlags } ,
55 types:: Zval ,
66 zend:: { ExecuteData , FunctionEntry , ZendType } ,
77} ;
@@ -64,6 +64,30 @@ impl<'a> FunctionBuilder<'a> {
6464 }
6565 }
6666
67+ /// Create a new function builder for an abstract function that can be used
68+ /// on an abstract class or an interface.
69+ ///
70+ /// # Parameters
71+ ///
72+ /// * `name` - The name of the function.
73+ pub fn new_abstract < T : Into < String > > ( name : T ) -> Self {
74+ Self {
75+ name : name. into ( ) ,
76+ function : FunctionEntry {
77+ fname : ptr:: null ( ) ,
78+ handler : None ,
79+ arg_info : ptr:: null ( ) ,
80+ num_args : 0 ,
81+ flags : MethodFlags :: Abstract . bits ( ) ,
82+ } ,
83+ args : vec ! [ ] ,
84+ n_req : None ,
85+ retval : None ,
86+ ret_as_ref : false ,
87+ ret_as_null : false ,
88+ }
89+ }
90+
6791 /// Creates a constructor builder, used to build the constructor
6892 /// for classes.
6993 ///
You can’t perform that action at this time.
0 commit comments