Skip to content

Commit 8ec5e6d

Browse files
committed
Add stubs for Spoofchecker
1 parent 4cf4059 commit 8ec5e6d

File tree

3 files changed

+55
-37
lines changed

3 files changed

+55
-37
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class Spoofchecker
4+
{
5+
public function __construct() {}
6+
7+
/** @return bool */
8+
public function isSuspicious(string $text, &$error = null) {}
9+
10+
/** @return bool */
11+
public function areConfusable(string $s1, string $s2, &$error = null) {}
12+
13+
/** @return void */
14+
public function setAllowedLocales(string $locale_list) {}
15+
16+
/** @return void */
17+
public function setChecks(int $checks) {}
18+
19+
/** @return void */
20+
public function setRestrictionLevel(int $level) {}
21+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* This is a generated file, edit the .stub.php file instead. */
2+
3+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker___construct, 0, 0, 0)
4+
ZEND_END_ARG_INFO()
5+
6+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_isSuspicious, 0, 0, 1)
7+
ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
8+
ZEND_ARG_INFO(1, error)
9+
ZEND_END_ARG_INFO()
10+
11+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_areConfusable, 0, 0, 2)
12+
ZEND_ARG_TYPE_INFO(0, s1, IS_STRING, 0)
13+
ZEND_ARG_TYPE_INFO(0, s2, IS_STRING, 0)
14+
ZEND_ARG_INFO(1, error)
15+
ZEND_END_ARG_INFO()
16+
17+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setAllowedLocales, 0, 0, 1)
18+
ZEND_ARG_TYPE_INFO(0, locale_list, IS_STRING, 0)
19+
ZEND_END_ARG_INFO()
20+
21+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setChecks, 0, 0, 1)
22+
ZEND_ARG_TYPE_INFO(0, checks, IS_LONG, 0)
23+
ZEND_END_ARG_INFO()
24+
25+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setRestrictionLevel, 0, 0, 1)
26+
ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0)
27+
ZEND_END_ARG_INFO()

ext/intl/spoofchecker/spoofchecker_class.c

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "spoofchecker_class.h"
1616
#include "spoofchecker_main.h"
1717
#include "spoofchecker_create.h"
18+
#include "spoofchecker_arginfo.h"
1819
#include "php_intl.h"
1920
#include "intl_error.h"
2021

@@ -58,49 +59,18 @@ zend_object *Spoofchecker_object_create(zend_class_entry *ce)
5859
* 'Spoofchecker' class registration structures & functions
5960
*/
6061

61-
/* {{{ Spoofchecker methods arguments info */
62-
ZEND_BEGIN_ARG_INFO_EX(spoofchecker_0_args, 0, 0, 0)
63-
ZEND_END_ARG_INFO()
64-
65-
ZEND_BEGIN_ARG_INFO_EX(spoofchecker_set_checks, 0, 0, 1)
66-
ZEND_ARG_INFO(0, checks)
67-
ZEND_END_ARG_INFO()
68-
69-
ZEND_BEGIN_ARG_INFO_EX(spoofchecker_set_allowed_locales, 0, 0, 1)
70-
ZEND_ARG_INFO(0, locale_list)
71-
ZEND_END_ARG_INFO()
72-
73-
ZEND_BEGIN_ARG_INFO_EX(spoofchecker_is_suspicous, 0, 0, 1)
74-
ZEND_ARG_INFO(0, text)
75-
ZEND_ARG_INFO(1, error)
76-
ZEND_END_ARG_INFO()
77-
78-
ZEND_BEGIN_ARG_INFO_EX(spoofchecker_are_confusable, 0, 0, 2)
79-
ZEND_ARG_INFO(0, s1)
80-
ZEND_ARG_INFO(0, s2)
81-
ZEND_ARG_INFO(1, error)
82-
ZEND_END_ARG_INFO()
83-
84-
#if U_ICU_VERSION_MAJOR_NUM >= 58
85-
ZEND_BEGIN_ARG_INFO_EX(spoofchecker_set_restriction_level, 0, 0, 1)
86-
ZEND_ARG_INFO(0, level)
87-
ZEND_END_ARG_INFO()
88-
#endif
89-
90-
/* }}} */
91-
9262
/* {{{ Spoofchecker_class_functions
9363
* Every 'Spoofchecker' class method has an entry in this table
9464
*/
9565

9666
static const zend_function_entry Spoofchecker_class_functions[] = {
97-
PHP_ME(Spoofchecker, __construct, spoofchecker_0_args, ZEND_ACC_PUBLIC)
98-
PHP_ME(Spoofchecker, isSuspicious, spoofchecker_is_suspicous, ZEND_ACC_PUBLIC)
99-
PHP_ME(Spoofchecker, areConfusable, spoofchecker_are_confusable, ZEND_ACC_PUBLIC)
100-
PHP_ME(Spoofchecker, setAllowedLocales, spoofchecker_set_allowed_locales, ZEND_ACC_PUBLIC)
101-
PHP_ME(Spoofchecker, setChecks, spoofchecker_set_checks, ZEND_ACC_PUBLIC)
67+
PHP_ME(Spoofchecker, __construct, arginfo_class_Spoofchecker___construct, ZEND_ACC_PUBLIC)
68+
PHP_ME(Spoofchecker, isSuspicious, arginfo_class_Spoofchecker_isSuspicious, ZEND_ACC_PUBLIC)
69+
PHP_ME(Spoofchecker, areConfusable, arginfo_class_Spoofchecker_areConfusable, ZEND_ACC_PUBLIC)
70+
PHP_ME(Spoofchecker, setAllowedLocales, arginfo_class_Spoofchecker_setAllowedLocales, ZEND_ACC_PUBLIC)
71+
PHP_ME(Spoofchecker, setChecks, arginfo_class_Spoofchecker_setChecks, ZEND_ACC_PUBLIC)
10272
#if U_ICU_VERSION_MAJOR_NUM >= 58
103-
PHP_ME(Spoofchecker, setRestrictionLevel, spoofchecker_set_restriction_level, ZEND_ACC_PUBLIC)
73+
PHP_ME(Spoofchecker, setRestrictionLevel, arginfo_class_Spoofchecker_setRestrictionLevel, ZEND_ACC_PUBLIC)
10474
#endif
10575
PHP_FE_END
10676
};

0 commit comments

Comments
 (0)