diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2021-02-14 15:21:24 +0100 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2021-02-15 00:11:22 +0100 |
commit | 5b5bfd6be48de4601d508fa5b8a7a572dda6b8bc (patch) | |
tree | 1750beb0dc141c3362e14f2105c2401319eddd68 /ext/pspell | |
parent | af56982a5ecd28291d18d2e091515ad25de1050e (diff) | |
download | php-git-5b5bfd6be48de4601d508fa5b8a7a572dda6b8bc.tar.gz |
Generate class entries from stubs for phar, posix, pspell, readline, reflection, session, shmop
Closes GH-6692
Diffstat (limited to 'ext/pspell')
-rw-r--r-- | ext/pspell/pspell.c | 9 | ||||
-rw-r--r-- | ext/pspell/pspell.stub.php | 4 | ||||
-rw-r--r-- | ext/pspell/pspell_arginfo.h | 25 |
3 files changed, 29 insertions, 9 deletions
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c index 8975519955..b965a22f61 100644 --- a/ext/pspell/pspell.c +++ b/ext/pspell/pspell.c @@ -150,10 +150,7 @@ static void php_pspell_config_object_free(zend_object *zobj) { /* {{{ PHP_MINIT_FUNCTION */ static PHP_MINIT_FUNCTION(pspell) { - zend_class_entry ce; - INIT_CLASS_ENTRY(ce, "PSpell", class_PSpell_methods); - php_pspell_ce = zend_register_internal_class(&ce); - php_pspell_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; + php_pspell_ce = register_class_PSpell(); php_pspell_ce->create_object = php_pspell_object_create; php_pspell_ce->serialize = zend_class_serialize_deny; php_pspell_ce->unserialize = zend_class_unserialize_deny; @@ -164,9 +161,7 @@ static PHP_MINIT_FUNCTION(pspell) php_pspell_handlers.get_constructor = php_pspell_object_get_constructor; php_pspell_handlers.offset = XtOffsetOf(php_pspell_object, std); - INIT_CLASS_ENTRY(ce, "PSpellConfig", class_PSpellConfig_methods); - php_pspell_config_ce = zend_register_internal_class(&ce); - php_pspell_config_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; + php_pspell_config_ce = register_class_PSpellConfig(); php_pspell_config_ce->create_object = php_pspell_config_object_create; php_pspell_config_ce->serialize = zend_class_serialize_deny; php_pspell_config_ce->unserialize = zend_class_unserialize_deny; diff --git a/ext/pspell/pspell.stub.php b/ext/pspell/pspell.stub.php index a10de4b9f9..40a2a73097 100644 --- a/ext/pspell/pspell.stub.php +++ b/ext/pspell/pspell.stub.php @@ -1,8 +1,10 @@ <?php -/** @generate-function-entries */ +/** @generate-class-entries */ +/** @strict-properties */ final class PSpell {} +/** @strict-properties */ final class PSpellConfig {} function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): PSpell|false {} diff --git a/ext/pspell/pspell_arginfo.h b/ext/pspell/pspell_arginfo.h index f3b7b55310..6a42dd58ae 100644 --- a/ext/pspell/pspell_arginfo.h +++ b/ext/pspell/pspell_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: efc4c20a1507cfba58ec265a2fe6f61b1e0f8a61 */ + * Stub hash: d7a2f6b4aa719778166e5a255432f03100184a42 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, PSpell, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0) @@ -143,3 +143,26 @@ static const zend_function_entry class_PSpell_methods[] = { static const zend_function_entry class_PSpellConfig_methods[] = { ZEND_FE_END }; + +zend_class_entry *register_class_PSpell() +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "PSpell", class_PSpell_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + + return class_entry; +} + +zend_class_entry *register_class_PSpellConfig() +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "PSpellConfig", class_PSpellConfig_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + + return class_entry; +} + |