Skip to content

Commit

Permalink
use zend_call_known_method/update arginfo
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Jan 17, 2022
1 parent 9db51f0 commit 62686e4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions tests/042.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if (!extension_loaded("yar")) {
print "skip";
}
?>
--INI--
report_memleaks=0
--FILE--
<?php
include "yar.inc";
Expand Down
6 changes: 3 additions & 3 deletions yar.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class Yar_Server {

/* properties */
protected object $_executor = NULL;
/* protected object $_executor = NULL; */

/* methods */
public function __construct(object $executor) {}
Expand Down Expand Up @@ -35,9 +35,9 @@ class Yar_Concurrent_Client {
/* properties */

/* methods */
public static function call(string $uri, string $method, array $arguments = NULL, callable $callback = NULL, callable $error_callback = NULL, array $options = NULL):null|int|bool {}
public static function call(string $uri, string $method, ?array $arguments = NULL, ?callable $callback = NULL, ?callable $error_callback = NULL, ?array $options = NULL):null|int|bool {}

public static function loop(callable $callback = NULL, callable $error_callback = NULL):?bool {}
public static function loop(?callable $callback = NULL, ?callable $error_callback = NULL):?bool {}

public static function reset():bool {}
}
Expand Down
14 changes: 7 additions & 7 deletions yar_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 763c2919da859afd6c29a276bb884191fdf19015 */
* Stub hash: c76c64f60b5bed6bfd71a7eebc17cac0eadf066a */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yar_Server___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, executor, IS_OBJECT, 0)
Expand Down Expand Up @@ -32,15 +32,15 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Yar_Concurrent_Client_call, 0, 2, MAY_BE_NULL|MAY_BE_LONG|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arguments, IS_ARRAY, 0, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 0, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_callback, IS_CALLABLE, 0, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arguments, IS_ARRAY, 1, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_callback, IS_CALLABLE, 1, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "NULL")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yar_Concurrent_Client_loop, 0, 0, _IS_BOOL, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 0, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_callback, IS_CALLABLE, 0, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "NULL")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_callback, IS_CALLABLE, 1, "NULL")
ZEND_END_ARG_INFO()

#define arginfo_class_Yar_Concurrent_Client_reset arginfo_class_Yar_Server_handle
Expand Down
2 changes: 1 addition & 1 deletion yar_legacy_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 763c2919da859afd6c29a276bb884191fdf19015 */
* Stub hash: c76c64f60b5bed6bfd71a7eebc17cac0eadf066a */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yar_Server___construct, 0, 0, 1)
ZEND_ARG_INFO(0, executor)
Expand Down
4 changes: 2 additions & 2 deletions yar_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static inline int php_yar_server_auth(zval *obj, yar_header_t *header, yar_respo
#if PHP_VERSION_ID < 80000
zend_call_method_with_2_params(obj, ce, NULL, "__auth", &ret, &auth_params[0], &auth_params[1]);
#else
zend_call_method_with_2_params(Z_OBJ_P(obj), ce, NULL, "__auth", &ret, &auth_params[0], &auth_params[1]);
zend_call_known_instance_method_with_2_params(fbc, Z_OBJ_P(obj), &ret, &auth_params[0], &auth_params[1]);
#endif
zend_string_release(Z_STR(auth_params[0]));
zend_string_release(Z_STR(auth_params[1]));
Expand Down Expand Up @@ -530,7 +530,7 @@ static void php_yar_server_info(zval *obj) /* {{{ */ {
#if PHP_VERSION_ID < 80000
zend_call_method_with_1_params(obj, ce, NULL, "__info", &ret, &html);
#else
zend_call_method_with_1_params(Z_OBJ_P(obj), ce, NULL, "__info", &ret, &html);
zend_call_known_instance_method_with_1_params(fbc, Z_OBJ_P(obj), &ret, &html);
#endif
zval_ptr_dtor(&html);
} zend_catch {
Expand Down

0 comments on commit 62686e4

Please sign in to comment.