}
/* }}} */
-static const zend_function_entry closure_functions[] = {
- ZEND_ME(Closure, __construct, arginfo_class_Closure___construct, ZEND_ACC_PRIVATE)
- ZEND_ME(Closure, bind, arginfo_class_Closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- ZEND_MALIAS(Closure, bindTo, bind, arginfo_class_Closure_bindTo, ZEND_ACC_PUBLIC)
- ZEND_ME(Closure, call, arginfo_class_Closure_call, ZEND_ACC_PUBLIC)
- ZEND_ME(Closure, fromCallable, arginfo_class_Closure_fromCallable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- ZEND_FE_END
-};
-
void zend_register_closure_ce(void) /* {{{ */
{
zend_class_entry ce;
- INIT_CLASS_ENTRY(ce, "Closure", closure_functions);
+ INIT_CLASS_ENTRY(ce, "Closure", class_Closure_methods);
zend_ce_closure = zend_register_internal_class(&ce);
zend_ce_closure->ce_flags |= ZEND_ACC_FINAL;
zend_ce_closure->create_object = zend_closure_new;
<?php
-Class Closure
+/** @generate-function-entries */
+
+final class Closure
{
private function __construct() {}
- /** @return ?Closure */
- public static function bind(Closure $closure, ?object $newthis, $newscope = UNKNOWN) {}
+ public static function bind(Closure $closure, ?object $newthis, $newscope = UNKNOWN): ?Closure {}
- /** @return ?Closure */
- public function bindTo(?object $newthis, $newscope = UNKNOWN) {}
+ /** @alias Closure::bind */
+ public function bindTo(?object $newthis, $newscope = UNKNOWN): ?Closure {}
/** @return mixed */
public function call(object $newthis, ...$parameters) {}
- /**
- * @param callable $callable Not a proper type annotation due to bug #78770
- * @return Closure
- */
- public function fromCallable($callable) {}
+ /** @param callable $callable Not a proper type annotation due to bug #78770 */
+ public static function fromCallable($callable): Closure {}
}
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure_bind, 0, 0, 2)
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_bind, 0, 2, Closure, 1)
ZEND_ARG_OBJ_INFO(0, closure, Closure, 0)
ZEND_ARG_TYPE_INFO(0, newthis, IS_OBJECT, 1)
ZEND_ARG_INFO(0, newscope)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure_bindTo, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_bindTo, 0, 1, Closure, 1)
ZEND_ARG_TYPE_INFO(0, newthis, IS_OBJECT, 1)
ZEND_ARG_INFO(0, newscope)
ZEND_END_ARG_INFO()
ZEND_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure_fromCallable, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_fromCallable, 0, 1, Closure, 0)
ZEND_ARG_INFO(0, callable)
ZEND_END_ARG_INFO()
+
+
+ZEND_METHOD(Closure, __construct);
+ZEND_METHOD(Closure, bind);
+ZEND_METHOD(Closure, call);
+ZEND_METHOD(Closure, fromCallable);
+
+
+static const zend_function_entry class_Closure_methods[] = {
+ ZEND_ME(Closure, __construct, arginfo_class_Closure___construct, ZEND_ACC_PRIVATE)
+ ZEND_ME(Closure, bind, arginfo_class_Closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_MALIAS(Closure, bindTo, bind, arginfo_class_Closure_bindTo, ZEND_ACC_PUBLIC)
+ ZEND_ME(Closure, call, arginfo_class_Closure_call, ZEND_ACC_PUBLIC)
+ ZEND_ME(Closure, fromCallable, arginfo_class_Closure_fromCallable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_FE_END
+};