Skip to content

Commit 9e68101

Browse files
committed
Fix
1 parent 9165bec commit 9e68101

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

src/zend/_type.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,31 +78,18 @@ impl ZendType {
7878
is_variadic: bool,
7979
allow_null: bool,
8080
) -> Option<Self> {
81-
cfg_if::cfg_if! {
82-
if #[cfg(php83)] {
83-
Some(Self {
84-
ptr: std::ffi::CString::new(class_name).ok()?.into_raw() as *mut c_void,
85-
type_mask: crate::ffi::_ZEND_TYPE_LITERAL_NAME_BIT
86-
| (if allow_null {
87-
_ZEND_TYPE_NULLABLE_BIT
88-
} else {
89-
0
90-
})
91-
| Self::arg_info_flags(pass_by_ref, is_variadic),
92-
})
81+
Some(Self {
82+
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
9385
} else {
94-
Some(Self {
95-
ptr: crate::types::ZendStr::new(class_name, true).into_raw().as_ptr() as *mut c_void,
96-
type_mask: crate::ffi::_ZEND_TYPE_NAME_BIT
97-
| (if allow_null {
98-
_ZEND_TYPE_NULLABLE_BIT
99-
} else {
100-
0
101-
})
102-
| Self::arg_info_flags(pass_by_ref, is_variadic),
103-
})
104-
}
105-
}
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),
92+
})
10693
}
10794

10895
/// Attempts to create a zend type for a primitive PHP type.

0 commit comments

Comments
 (0)