Declare ext/pspell constants in stubs (#9096)

This commit is contained in:
Máté Kocsis 2022-07-22 13:08:44 +02:00 committed by GitHub
parent 0490f082e9
commit f72d264560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 8 deletions

View file

@ -32,7 +32,6 @@
#include "php_pspell.h"
#include <pspell.h>
#include "ext/standard/info.h"
#include "pspell_arginfo.h"
#define PSPELL_FAST 1L
#define PSPELL_NORMAL 2L
@ -40,6 +39,8 @@
#define PSPELL_SPEED_MASK_INTERNAL 3L
#define PSPELL_RUN_TOGETHER 8L
#include "pspell_arginfo.h"
/* Largest ignored word can be 999 characters (this seems sane enough),
* and it takes 3 bytes to represent that (see pspell_config_ignore)
*/
@ -167,10 +168,7 @@ static PHP_MINIT_FUNCTION(pspell)
php_pspell_config_handlers.get_constructor = php_pspell_config_object_get_constructor;
php_pspell_config_handlers.offset = XtOffsetOf(php_pspell_config_object, std);
REGISTER_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("PSPELL_BAD_SPELLERS", PSPELL_BAD_SPELLERS, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("PSPELL_RUN_TOGETHER", PSPELL_RUN_TOGETHER, CONST_PERSISTENT | CONST_CS);
register_pspell_symbols(module_number);
return SUCCESS;
}

View file

@ -3,7 +3,6 @@
/** @generate-class-entries */
namespace PSpell {
/**
* @strict-properties
* @not-serializable
@ -15,10 +14,29 @@ namespace PSpell {
* @not-serializable
*/
final class Config {}
}
namespace {
/**
* @var int
* @cvalue PSPELL_FAST
*/
const PSPELL_FAST = UNKNOWN;
/**
* @var int
* @cvalue PSPELL_NORMAL
*/
const PSPELL_NORMAL = UNKNOWN;
/**
* @var int
* @cvalue PSPELL_BAD_SPELLERS
*/
const PSPELL_BAD_SPELLERS = UNKNOWN;
/**
* @var int
* @cvalue PSPELL_RUN_TOGETHER
*/
const PSPELL_RUN_TOGETHER = UNKNOWN;
function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): PSpell\Dictionary|false {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 54253af8d28520254e062171733c753d7104ec6b */
* Stub hash: 8d35f61a0b48c5422b31e78f587d9258fd3e8e37 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, PSpell\\Dictionary, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
@ -144,6 +144,14 @@ static const zend_function_entry class_PSpell_Config_methods[] = {
ZEND_FE_END
};
static void register_pspell_symbols(int module_number)
{
REGISTER_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PSPELL_BAD_SPELLERS", PSPELL_BAD_SPELLERS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PSPELL_RUN_TOGETHER", PSPELL_RUN_TOGETHER, CONST_CS | CONST_PERSISTENT);
}
static zend_class_entry *register_class_PSpell_Dictionary(void)
{
zend_class_entry ce, *class_entry;