Skip to content

Commit c49899d

Browse files
committed
Update
1 parent 9e68101 commit c49899d

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/zend/_type.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,21 @@ impl ZendType {
7878
is_variadic: bool,
7979
allow_null: bool,
8080
) -> Option<Self> {
81+
let mut flags = Self::arg_info_flags(pass_by_ref, is_variadic);
82+
if allow_null {
83+
flags |= _ZEND_TYPE_NULLABLE_BIT
84+
}
85+
cfg_if::cfg_if! {
86+
if #[cfg(php83)] {
87+
flags |= crate::ffi::_ZEND_TYPE_LITERAL_NAME_BIT
88+
} else {
89+
flags |= crate::ffi::_ZEND_TYPE_NAME_BIT
90+
}
91+
}
92+
8193
Some(Self {
8294
ptr: std::ffi::CString::new(class_name).ok()?.into_raw() as *mut c_void,
83-
type_mask: if cfg!(php83) {
84-
crate::ffi::_ZEND_TYPE_LITERAL_NAME_BIT
85-
} else {
86-
crate::ffi::_ZEND_TYPE_NAME_BIT
87-
} | (if allow_null {
88-
_ZEND_TYPE_NULLABLE_BIT
89-
} else {
90-
0
91-
}) | Self::arg_info_flags(pass_by_ref, is_variadic),
95+
type_mask: flags,
9296
})
9397
}
9498

0 commit comments

Comments
 (0)