Skip to content

Commit bee7a76

Browse files
committed
Fix review comments
1 parent 7585b07 commit bee7a76

13 files changed

+52
-68
lines changed

ext/dom/php_dom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void dom_child_node_remove(dom_object *context);
141141
}
142142

143143
#define DOM_NO_ARGS() \
144-
if (zend_parse_parameters_none() == failure) { \
144+
if (zend_parse_parameters_none() == FAILURE) { \
145145
RETURN_THROWS(); \
146146
}
147147

ext/standard/assert.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
/* {{{ includes */
1818
#include "php.h"
1919
#include "php_assert.h"
20-
#include "assert_arginfo.h"
2120
#include "php_ini.h"
2221
#include "zend_exceptions.h"
2322
/* }}} */
@@ -33,8 +32,6 @@ ZEND_END_MODULE_GLOBALS(assert)
3332

3433
ZEND_DECLARE_MODULE_GLOBALS(assert)
3534

36-
static zend_class_entry *assertion_error_ce;
37-
3835
#define ASSERTG(v) ZEND_MODULE_GLOBALS_ACCESSOR(assert, v)
3936

4037
#define SAFE_STRING(s) ((s)?(s):"")
@@ -100,8 +97,6 @@ PHP_MINIT_FUNCTION(assert) /* {{{ */
10097
REGISTER_LONG_CONSTANT("ASSERT_WARNING", ASSERT_WARNING, CONST_CS|CONST_PERSISTENT);
10198
REGISTER_LONG_CONSTANT("ASSERT_EXCEPTION", ASSERT_EXCEPTION, CONST_CS|CONST_PERSISTENT);
10299

103-
assertion_error_ce = register_class_AssertionError(zend_ce_error);
104-
105100
return SUCCESS;
106101
}
107102
/* }}} */

ext/standard/assert.stub.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

ext/standard/assert_arginfo.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

ext/standard/basic_functions.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
#include "php.h"
19+
#include "php_assert.h"
1920
#include "php_streams.h"
2021
#include "php_main.h"
2122
#include "php_globals.h"
@@ -283,7 +284,10 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
283284
#endif
284285
#endif
285286

286-
php_register_incomplete_class();
287+
php_ce_incomplete_class = register_class___PHP_Incomplete_Class();
288+
php_register_incomplete_class_handlers();
289+
290+
assertion_error_ce = register_class_AssertionError(zend_ce_error);
287291

288292
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
289293
REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);

ext/standard/basic_functions.stub.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
/** @generate-class-entries */
44

5+
final class __PHP_Incomplete_Class
6+
{
7+
}
8+
9+
class AssertionError extends Error
10+
{
11+
}
12+
513
/* main/main.c */
614

715
function set_time_limit(int $seconds): bool {}

ext/standard/basic_functions_arginfo.h

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: adbca296811725459f6fbede5a279256675ad19e */
2+
* Stub hash: 97edf8c87780c892984099e52ad1c6c745b919f8 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
@@ -3491,3 +3491,34 @@ static const zend_function_entry ext_functions[] = {
34913491
#endif
34923492
ZEND_FE_END
34933493
};
3494+
3495+
3496+
static const zend_function_entry class___PHP_Incomplete_Class_methods[] = {
3497+
ZEND_FE_END
3498+
};
3499+
3500+
3501+
static const zend_function_entry class_AssertionError_methods[] = {
3502+
ZEND_FE_END
3503+
};
3504+
3505+
static zend_class_entry *register_class___PHP_Incomplete_Class(void)
3506+
{
3507+
zend_class_entry ce, *class_entry;
3508+
3509+
INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", class___PHP_Incomplete_Class_methods);
3510+
class_entry = zend_register_internal_class_ex(&ce, NULL);
3511+
class_entry->ce_flags |= ZEND_ACC_FINAL;
3512+
3513+
return class_entry;
3514+
}
3515+
3516+
static zend_class_entry *register_class_AssertionError(zend_class_entry *class_entry_Error)
3517+
{
3518+
zend_class_entry ce, *class_entry;
3519+
3520+
INIT_CLASS_ENTRY(ce, "AssertionError", class_AssertionError_methods);
3521+
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
3522+
3523+
return class_entry;
3524+
}

ext/standard/incomplete_class.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include "php.h"
1818
#include "basic_functions.h"
19-
#include "basic_functions_arginfo.h"
20-
#include "incomplete_class_arginfo.h"
2119
#include "php_incomplete_class.h"
2220

2321
#define INCOMPLETE_CLASS_MSG \
@@ -110,7 +108,7 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type)
110108
return object;
111109
}
112110

113-
PHPAPI void php_register_incomplete_class(void)
111+
PHPAPI void php_register_incomplete_class_handlers(void)
114112
{
115113
memcpy(&php_incomplete_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
116114
php_incomplete_object_handlers.read_property = incomplete_class_get_property;
@@ -120,7 +118,6 @@ PHPAPI void php_register_incomplete_class(void)
120118
php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr;
121119
php_incomplete_object_handlers.get_method = incomplete_class_get_method;
122120

123-
php_ce_incomplete_class = register_class___PHP_Incomplete_Class();
124121
php_ce_incomplete_class->create_object = php_create_incomplete_object;
125122
}
126123
/* }}} */

ext/standard/incomplete_class.stub.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

ext/standard/incomplete_class_arginfo.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

ext/standard/php_assert.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ PHP_RINIT_FUNCTION(assert);
2323
PHP_RSHUTDOWN_FUNCTION(assert);
2424
PHP_MINFO_FUNCTION(assert);
2525

26+
static zend_class_entry *assertion_error_ce;
27+
2628
#endif /* PHP_ASSERT_H */

ext/standard/php_incomplete_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extern PHPAPI zend_class_entry *php_ce_incomplete_class;
4949
extern "C" {
5050
#endif
5151

52-
PHPAPI void php_register_incomplete_class(void);
52+
PHPAPI void php_register_incomplete_class_handlers(void);
5353
PHPAPI zend_string *php_lookup_class_name(zend_object *object);
5454
PHPAPI void php_store_class_name(zval *object, zend_string *name);
5555

ext/standard/user_filters.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PHP_METHOD(php_user_filter, onClose)
5858
ZEND_PARSE_PARAMETERS_NONE();
5959
}
6060

61-
static zend_class_entry user_filter_class_entry;
61+
static zend_class_entry *user_filter_class_entry;
6262

6363
static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
6464
{
@@ -72,7 +72,7 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
7272
PHP_MINIT_FUNCTION(user_filters)
7373
{
7474
/* init the filter class ancestor */
75-
zend_class_entry *php_user_filter = register_class_php_user_filter();
75+
user_filter_class_entry = register_class_php_user_filter();
7676

7777
/* init the filter resource; it has no dtor, as streams will always clean it up
7878
* at the correct time */

0 commit comments

Comments
 (0)