Skip to content

Declare ext/pspell constants in stubs #9096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions ext/pspell/pspell.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@
#include "php_pspell.h"
#include <pspell.h>
#include "ext/standard/info.h"
#include "pspell_arginfo.h"

#define PSPELL_FAST 1L
#define PSPELL_NORMAL 2L
#define PSPELL_BAD_SPELLERS 3L
#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)
*/
Expand Down Expand Up @@ -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;
}
Expand Down
22 changes: 20 additions & 2 deletions ext/pspell/pspell.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/** @generate-class-entries */

namespace PSpell {

/**
* @strict-properties
* @not-serializable
Expand All @@ -15,10 +14,29 @@ final class Dictionary {}
* @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 {}

Expand Down
10 changes: 9 additions & 1 deletion ext/pspell/pspell_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.