Skip to content

Review parameter names in ext/gettext #6241

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

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 8 additions & 8 deletions ext/gettext/gettext.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@

function textdomain(?string $domain): string {}

function gettext(string $msgid): string {}
function gettext(string $message): string {}

/** @alias gettext */
function _(string $msgid): string {}
function _(string $message): string {}

function dgettext(string $domain, string $msgid): string {}
function dgettext(string $domain, string $message): string {}

function dcgettext(string $domain, string $msgid, int $category): string {}
function dcgettext(string $domain, string $message, int $category): string {}

function bindtextdomain(string $domain, string $dir): string|false {}
function bindtextdomain(string $domain, string $directory): string|false {}

#ifdef HAVE_NGETTEXT
function ngettext(string $msgid1, string $msgid2, int $n): string {}
function ngettext(string $singular, string $plural, int $count): string {}
#endif

#ifdef HAVE_DNGETTEXT
function dngettext(string $domain, string $msgid1, string $msgid2, int $count): string {}
function dngettext(string $domain, string $singular, string $plural, int $count): string {}
#endif

#ifdef HAVE_DCNGETTEXT
function dcngettext(string $domain, string $msgid1, string $msgid2, int $count, int $category): string {}
function dcngettext(string $domain, string $singular, string $plural, int $count, int $category): string {}
#endif

#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
Expand Down
24 changes: 12 additions & 12 deletions ext/gettext/gettext_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a8b64ae24724f0552a62cd4146f6cfb3cd75fa19 */
* Stub hash: 7d0fe93cb15576756edc5aad71deadae67046690 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_textdomain, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gettext, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
ZEND_END_ARG_INFO()

#define arginfo__ arginfo_gettext

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dgettext, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dcgettext, 0, 3, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, category, IS_LONG, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bindtextdomain, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, dir, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
ZEND_END_ARG_INFO()

#if defined(HAVE_NGETTEXT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ngettext, 0, 3, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, singular, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, plural, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif

#if defined(HAVE_DNGETTEXT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dngettext, 0, 4, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, singular, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, plural, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif

#if defined(HAVE_DCNGETTEXT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dcngettext, 0, 5, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, singular, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, plural, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, category, IS_LONG, 0)
ZEND_END_ARG_INFO()
Expand Down
18 changes: 9 additions & 9 deletions ext/gettext/tests/44938.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ try {
--EXPECT--
bindtextdomain(): Argument #1 ($domain) is too long
dngettext(): Argument #1 ($domain) is too long
dngettext(): Argument #2 ($msgid1) is too long
dngettext(): Argument #3 ($msgid2) is too long
gettext(): Argument #1 ($msgid) is too long
ngettext(): Argument #1 ($msgid1) is too long
ngettext(): Argument #2 ($msgid2) is too long
dngettext(): Argument #2 ($singular) is too long
dngettext(): Argument #3 ($plural) is too long
gettext(): Argument #1 ($message) is too long
ngettext(): Argument #1 ($singular) is too long
ngettext(): Argument #2 ($plural) is too long
dcgettext(): Argument #1 ($domain) is too long
dcgettext(): Argument #2 ($msgid) is too long
dcgettext(): Argument #2 ($message) is too long
dcngettext(): Argument #1 ($domain) is too long
dcngettext(): Argument #2 ($msgid1) is too long
dcngettext(): Argument #3 ($msgid2) is too long
dcngettext(): Argument #2 ($singular) is too long
dcngettext(): Argument #3 ($plural) is too long
dgettext(): Argument #1 ($domain) is too long
dgettext(): Argument #2 ($msgid) is too long
dgettext(): Argument #2 ($message) is too long
textdomain(): Argument #1 ($domain) is too long