1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add stubs for aliases

Closes GH-5187
This commit is contained in:
Máté Kocsis
2020-02-18 19:59:15 +01:00
parent 172010a08d
commit 736b22dc0b
25 changed files with 295 additions and 164 deletions

View File

@@ -16,9 +16,9 @@
ZEND_PARSE_PARAMETERS_END()
#endif
/* {{{ void %EXTNAME%_test1()
/* {{{ void test1()
*/
PHP_FUNCTION(%EXTNAME%_test1)
PHP_FUNCTION(test1)
{
ZEND_PARSE_PARAMETERS_NONE();
@@ -70,8 +70,8 @@ PHP_MINFO_FUNCTION(%EXTNAME%)
/* {{{ %EXTNAME%_functions[]
*/
static const zend_function_entry %EXTNAME%_functions[] = {
PHP_FE(%EXTNAME%_test1, arginfo_%EXTNAME%_test1)
PHP_FE(%EXTNAME%_test2, arginfo_%EXTNAME%_test2)
PHP_FE(test1, arginfo_test1)
PHP_FE(test2, arginfo_test2)
PHP_FE_END
};
/* }}} */

View File

@@ -1,5 +1,5 @@
<?php
function %EXTNAME%_test1(): void {}
function test1(): void {}
function %EXTNAME%_test2(string $str = ""): string {}
function test2(string $str = ""): string {}

View File

@@ -0,0 +1,8 @@
/* This is a generated file, edit the .stub.php file instead. */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test1, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test2, 0, 0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
ZEND_END_ARG_INFO()

View File

@@ -1,5 +1,5 @@
--TEST--
%EXTNAME%_test1() Basic test
test1() Basic test
--SKIPIF--
<?php
if (!extension_loaded('%EXTNAME%')) {
@@ -8,7 +8,7 @@ if (!extension_loaded('%EXTNAME%')) {
?>
--FILE--
<?php
$ret = %EXTNAME%_test1();
$ret = test1();
var_dump($ret);
?>