Skip to content

Commit f72d264

Browse files
authored
Declare ext/pspell constants in stubs (#9096)
1 parent 0490f08 commit f72d264

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

ext/pspell/pspell.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@
3232
#include "php_pspell.h"
3333
#include <pspell.h>
3434
#include "ext/standard/info.h"
35-
#include "pspell_arginfo.h"
3635

3736
#define PSPELL_FAST 1L
3837
#define PSPELL_NORMAL 2L
3938
#define PSPELL_BAD_SPELLERS 3L
4039
#define PSPELL_SPEED_MASK_INTERNAL 3L
4140
#define PSPELL_RUN_TOGETHER 8L
4241

42+
#include "pspell_arginfo.h"
43+
4344
/* Largest ignored word can be 999 characters (this seems sane enough),
4445
* and it takes 3 bytes to represent that (see pspell_config_ignore)
4546
*/
@@ -167,10 +168,7 @@ static PHP_MINIT_FUNCTION(pspell)
167168
php_pspell_config_handlers.get_constructor = php_pspell_config_object_get_constructor;
168169
php_pspell_config_handlers.offset = XtOffsetOf(php_pspell_config_object, std);
169170

170-
REGISTER_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_PERSISTENT | CONST_CS);
171-
REGISTER_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_PERSISTENT | CONST_CS);
172-
REGISTER_LONG_CONSTANT("PSPELL_BAD_SPELLERS", PSPELL_BAD_SPELLERS, CONST_PERSISTENT | CONST_CS);
173-
REGISTER_LONG_CONSTANT("PSPELL_RUN_TOGETHER", PSPELL_RUN_TOGETHER, CONST_PERSISTENT | CONST_CS);
171+
register_pspell_symbols(module_number);
174172

175173
return SUCCESS;
176174
}

ext/pspell/pspell.stub.php

+20-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/** @generate-class-entries */
44

55
namespace PSpell {
6-
76
/**
87
* @strict-properties
98
* @not-serializable
@@ -15,10 +14,29 @@ final class Dictionary {}
1514
* @not-serializable
1615
*/
1716
final class Config {}
18-
1917
}
2018

2119
namespace {
20+
/**
21+
* @var int
22+
* @cvalue PSPELL_FAST
23+
*/
24+
const PSPELL_FAST = UNKNOWN;
25+
/**
26+
* @var int
27+
* @cvalue PSPELL_NORMAL
28+
*/
29+
const PSPELL_NORMAL = UNKNOWN;
30+
/**
31+
* @var int
32+
* @cvalue PSPELL_BAD_SPELLERS
33+
*/
34+
const PSPELL_BAD_SPELLERS = UNKNOWN;
35+
/**
36+
* @var int
37+
* @cvalue PSPELL_RUN_TOGETHER
38+
*/
39+
const PSPELL_RUN_TOGETHER = UNKNOWN;
2240

2341
function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): PSpell\Dictionary|false {}
2442

ext/pspell/pspell_arginfo.h

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)