Skip to content

Commit 5716b28

Browse files
committed
Add stubs for idn functions
1 parent 735c4ca commit 5716b28

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
@@ -84,6 +84,7 @@
8484
#include "breakiterator/breakiterator_iterators.h"
8585

8686
#include "idn/idn.h"
87+
#include "idn/idn_arginfo.h"
8788
#include "uchar/uchar.h"
8889

8990
# include "spoofchecker/spoofchecker_class.h"
@@ -373,13 +374,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_create, 0, 0, 3)
373374
ZEND_ARG_INFO(0, pattern)
374375
ZEND_END_ARG_INFO()
375376

376-
ZEND_BEGIN_ARG_INFO_EX(arginfo_idn_to_ascii, 0, 0, 1)
377-
ZEND_ARG_INFO(0, domain)
378-
ZEND_ARG_INFO(0, option)
379-
ZEND_ARG_INFO(0, variant)
380-
ZEND_ARG_INFO(1, idn_info)
381-
ZEND_END_ARG_INFO()
382-
383377
ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_create_proc, 0, 0, 2 )
384378
ZEND_ARG_INFO( 0, locale )
385379
ZEND_ARG_INFO( 0, bundlename )
@@ -680,7 +674,7 @@ static const zend_function_entry intl_functions[] = {
680674

681675
/* IDN functions */
682676
PHP_FE( idn_to_ascii, arginfo_idn_to_ascii)
683-
PHP_FE( idn_to_utf8, arginfo_idn_to_ascii)
677+
PHP_FE( idn_to_utf8, arginfo_idn_to_utf8)
684678

685679
/* ResourceBundle functions */
686680
PHP_FE( resourcebundle_create, arginfo_resourcebundle_create_proc )

0 commit comments

Comments
 (0)