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 {
85
85
/// * `func` - The function entry to add to the class.
86
86
/// * `flags` - Flags relating to the function. See [`MethodFlags`].
87
87
pub fn method ( mut self , mut func : FunctionEntry , flags : MethodFlags ) -> Self {
88
- func. flags = flags. bits ( ) ;
88
+ func. flags | = flags. bits ( ) ;
89
89
self . methods . push ( func) ;
90
90
self
91
91
}
Original file line number Diff line number Diff line change 1
1
use crate :: {
2
2
args:: { Arg , ArgInfo } ,
3
3
error:: { Error , Result } ,
4
- flags:: DataType ,
4
+ flags:: { DataType , MethodFlags } ,
5
5
types:: Zval ,
6
6
zend:: { ExecuteData , FunctionEntry , ZendType } ,
7
7
} ;
@@ -64,6 +64,30 @@ impl<'a> FunctionBuilder<'a> {
64
64
}
65
65
}
66
66
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
+
67
91
/// Creates a constructor builder, used to build the constructor
68
92
/// for classes.
69
93
///
You can’t perform that action at this time.
0 commit comments