@@ -17,8 +17,8 @@ use crate::{
1717pub type ZendObject = zend_object ;
1818pub type ZendObjectHandlers = zend_object_handlers ;
1919
20- /// Implemented by the [`object_override_handler`] macro on a type T which is used as the T type
21- /// for [`ZendClassObject`].
20+ /// Implemented by the [`ZendObjectHandler`](ext_php_rs_derive::ZendObjectHandler) macro on a type T
21+ /// which is used as the T type for [`ZendClassObject`].
2222/// Implements a function `create_object` which is passed to a PHP class entry to instantiate the
2323/// object that will represent an object.
2424pub trait ZendObjectOverride {
@@ -42,12 +42,11 @@ pub struct ZendClassObject<T: Default> {
4242}
4343
4444impl < T : Default > ZendClassObject < T > {
45- /// Allocates a new object when an instance of the class is created
46- /// in the PHP world.
45+ /// Allocates a new object when an instance of the class is created in the PHP world.
4746 ///
4847 /// Internal function. The end user functions are generated by the
49- /// [`object_override_handler`] macro which generates a function that
50- /// wraps this function to be exported to C.
48+ /// [`ZendObjectHandler`](ext_php_rs_derive::ZendObjectHandler) derive macro which generates a
49+ /// function that wraps this function to be exported to C.
5150 ///
5251 /// # Parameters
5352 ///
@@ -56,13 +55,10 @@ impl<T: Default> ZendClassObject<T> {
5655 ///
5756 /// # Safety
5857 ///
59- /// This function is an internal function which is called only from
60- /// the function generated by the [`object_override_handler`] macro,
61- /// which in turn is called from the PHP runtime. PHP guarantees that
62- /// the given [`ClassEntry`] is valid. The `handlers` to this function
63- /// are also initialized by the [`object_handlers_init`] macro.
64- /// However, we cannot ensure the user will call both of these macros
65- /// in the same place.
58+ /// This function is an internal function which is only called from code which is derived using
59+ /// the [`ZendObjectHandler`](ext_php_rs_derive::ZendObjectHandler) derive macro. PHP will
60+ /// guarantee that any pointers given to this function will be valid, therefore we can Unwrap
61+ /// them with safety.
6662 pub unsafe fn new_ptr (
6763 ce : * mut ClassEntry ,
6864 handlers : * mut ZendObjectHandlers ,
0 commit comments