Skip to content

Commit 927dbfe

Browse files
committed
Add stubs for idn functions
1 parent 1658b5b commit 927dbfe

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

ext/intl/idn/idn.stub.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
/** @return string|false */
4+
function idn_to_ascii(string $domain, int $options = 0, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null) {}
5+
6+
/** @return string|false */
7+
function idn_to_utf8(string $domain, int $options = 0, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null) {}

ext/intl/idn/idn_arginfo.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* This is a generated file, edit the .stub.php file instead. */
2+
3+
ZEND_BEGIN_ARG_INFO_EX(arginfo_idn_to_ascii, 0, 0, 1)
4+
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
5+
ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0)
6+
ZEND_ARG_TYPE_INFO(0, variant, IS_LONG, 0)
7+
ZEND_ARG_INFO(1, idna_info)
8+
ZEND_END_ARG_INFO()
9+
10+
#define arginfo_idn_to_utf8 arginfo_idn_to_ascii

ext/intl/php_intl.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
#include "breakiterator/breakiterator_iterators.h"
8686

8787
#include "idn/idn.h"
88+
#include "idn/idn_arginfo.h"
8889
#include "uchar/uchar.h"
8990

9091
# include "spoofchecker/spoofchecker_class.h"
@@ -349,13 +350,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_create, 0, 0, 3)
349350
ZEND_ARG_INFO(0, pattern)
350351
ZEND_END_ARG_INFO()
351352

352-
ZEND_BEGIN_ARG_INFO_EX(arginfo_idn_to_ascii, 0, 0, 1)
353-
ZEND_ARG_INFO(0, domain)
354-
ZEND_ARG_INFO(0, option)
355-
ZEND_ARG_INFO(0, variant)
356-
ZEND_ARG_INFO(1, idn_info)
357-
ZEND_END_ARG_INFO()
358-
359353
ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_create_proc, 0, 0, 2 )
360354
ZEND_ARG_INFO( 0, locale )
361355
ZEND_ARG_INFO( 0, bundlename )
@@ -656,7 +650,7 @@ static const zend_function_entry intl_functions[] = {
656650

657651
/* IDN functions */
658652
PHP_FE( idn_to_ascii, arginfo_idn_to_ascii)
659-
PHP_FE( idn_to_utf8, arginfo_idn_to_ascii)
653+
PHP_FE( idn_to_utf8, arginfo_idn_to_utf8)
660654

661655
/* ResourceBundle functions */
662656
PHP_FE( resourcebundle_create, arginfo_resourcebundle_create_proc )

0 commit comments

Comments
 (0)