Skip to content

Commit f695ad3

Browse files
committed
Address another round of review comments + fix tests
1 parent 7404770 commit f695ad3

File tree

9 files changed

+22
-42
lines changed

9 files changed

+22
-42
lines changed

build/gen_stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ function parseFunctionLike(
778778
$paramMeta[$varName] = [];
779779
}
780780
$paramMeta[$varName]['preferRef'] = true;
781-
} else if ($tag->name === 'alias' || $tag->name === 'implementation-alias') {
781+
} else if ($tag->name === 'alias' || $tag->name === 'implementation-alias' || $tag->name === 'static-method-alias') {
782782
$aliasType = $tag->name;
783783
$aliasParts = explode("::", $tag->getValue());
784784
if (count($aliasParts) === 1) {
@@ -1342,7 +1342,7 @@ function initPhpParser() {
13421342
/** @var FuncInfo $funcInfo */
13431343
$funcMap[$funcInfo->name->__toString()] = $funcInfo;
13441344

1345-
if ($funcInfo->aliasType === "alias") {
1345+
if ($funcInfo->aliasType === "alias" || $funcInfo->aliasType === "static-method-alias") {
13461346
$aliases[] = $funcInfo;
13471347
}
13481348
}
@@ -1358,7 +1358,7 @@ function initPhpParser() {
13581358
$aliasedArgs = $aliasedFunc->args;
13591359
$aliasArgs = $aliasFunc->args;
13601360

1361-
if ($aliasFunc->isInstanceMethod() !== $aliasedFunc->isInstanceMethod()) {
1361+
if ($aliasFunc->isInstanceMethod() !== $aliasedFunc->isInstanceMethod() && $aliasFunc->aliasType !== "static-method-alias") {
13621362
if ($aliasFunc->isInstanceMethod()) {
13631363
$aliasedArgs = array_slice($aliasedArgs, 1);
13641364
}

ext/date/tests/68062.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ try {
1515
?>
1616
--EXPECT--
1717
3600
18-
DateTimeZone::getOffset(): Argument #1 ($object) must be of type DateTimeInterface, int given
18+
DateTimeZone::getOffset(): Argument #1 ($datetime) must be of type DateTimeInterface, int given

ext/mysqli/mysqli.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public function commit(int $flags = -1, ?string $name = null) {}
5555

5656
/**
5757
* @return mysqli|null|false
58-
* @alias mysqli_connect
58+
* @static-method-alias mysqli_connect
5959
*/
60-
public static function connect(
60+
public function connect(
6161
?string $hostname = null,
6262
?string $username = null,
6363
?string $password = null,

ext/mysqli/mysqli_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 200fdd7f3ae0ded20b43486f162d207b7fd09712 */
2+
* Stub hash: b156847f2617389de5381e5bd5e2fedb27bd7eed */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
55
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
@@ -957,7 +957,7 @@ static const zend_function_entry class_mysqli_methods[] = {
957957
ZEND_ME_MAPPING(character_set_name, mysqli_character_set_name, arginfo_class_mysqli_character_set_name, ZEND_ACC_PUBLIC)
958958
ZEND_ME_MAPPING(close, mysqli_close, arginfo_class_mysqli_close, ZEND_ACC_PUBLIC)
959959
ZEND_ME_MAPPING(commit, mysqli_commit, arginfo_class_mysqli_commit, ZEND_ACC_PUBLIC)
960-
ZEND_ME_MAPPING(connect, mysqli_connect, arginfo_class_mysqli_connect, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
960+
ZEND_ME_MAPPING(connect, mysqli_connect, arginfo_class_mysqli_connect, ZEND_ACC_PUBLIC)
961961
ZEND_ME_MAPPING(dump_debug_info, mysqli_dump_debug_info, arginfo_class_mysqli_dump_debug_info, ZEND_ACC_PUBLIC)
962962
ZEND_ME_MAPPING(debug, mysqli_debug, arginfo_class_mysqli_debug, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
963963
ZEND_ME_MAPPING(get_charset, mysqli_get_charset, arginfo_class_mysqli_get_charset, ZEND_ACC_PUBLIC)

ext/oci8/oci8.stub.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ function oci_lob_is_equal(OCILob $lob1, OCILob $lob2): bool {}
8989

9090
function oci_lob_export(OCILob $lob, string $filename, ?int $offset = null, ?int $length = null): bool {}
9191

92-
function oci_lob_write_temporary(OCILob $lob, string $data, int $type = OCI_TEMP_CLOB): bool {}
93-
94-
function oci_lob_close(OCILob $lob): bool {}
95-
9692
/**
9793
* @alias oci_lob_export
9894
* @deprecated
@@ -658,16 +654,10 @@ public function writetofile(string $filename, ?int $offset = null, ?int $length
658654
*/
659655
public function export(string $filename, ?int $offset = null, ?int $length = null) {}
660656

661-
/**
662-
* @alias oci_lob_write_temporary
663-
* @return bool
664-
*/
657+
/** @return bool */
665658
public function writetemporary(string $data, int $type = OCI_TEMP_CLOB) {}
666659

667-
/**
668-
* @alias oci_lob_close
669-
* @return bool
670-
*/
660+
/** @return bool */
671661
public function close() {}
672662

673663
/**

ext/oci8/oci8_arginfo.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 7fc2631cb9b0ec3c50c895e2789774dec45adf15 */
2+
* Stub hash: e7a7a9402b2668136f9f47d6e547e3af46a78a50 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0)
55
ZEND_ARG_INFO(0, statement)
@@ -129,14 +129,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_export, 0, 2, _IS_BOOL,
129129
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
130130
ZEND_END_ARG_INFO()
131131

132-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_write_temporary, 0, 2, _IS_BOOL, 0)
133-
ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0)
134-
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
135-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "OCI_TEMP_CLOB")
136-
ZEND_END_ARG_INFO()
137-
138-
#define arginfo_oci_lob_close arginfo_oci_free_descriptor
139-
140132
#define arginfo_ociwritelobtofile arginfo_oci_lob_export
141133

142134
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_oci_new_descriptor, 0, 1, OCILob, 1)
@@ -573,8 +565,6 @@ ZEND_FUNCTION(ocigetbufferinglob);
573565
ZEND_FUNCTION(oci_lob_copy);
574566
ZEND_FUNCTION(oci_lob_is_equal);
575567
ZEND_FUNCTION(oci_lob_export);
576-
ZEND_FUNCTION(oci_lob_write_temporary);
577-
ZEND_FUNCTION(oci_lob_close);
578568
ZEND_FUNCTION(oci_new_descriptor);
579569
ZEND_FUNCTION(oci_rollback);
580570
ZEND_FUNCTION(oci_commit);
@@ -629,6 +619,8 @@ ZEND_FUNCTION(oci_collection_trim);
629619
ZEND_FUNCTION(oci_new_collection);
630620
ZEND_FUNCTION(oci_register_taf_callback);
631621
ZEND_FUNCTION(oci_unregister_taf_callback);
622+
ZEND_METHOD(OCILob, writetemporary);
623+
ZEND_METHOD(OCILob, close);
632624

633625

634626
static const zend_function_entry ext_functions[] = {
@@ -661,8 +653,6 @@ static const zend_function_entry ext_functions[] = {
661653
ZEND_FE(oci_lob_copy, arginfo_oci_lob_copy)
662654
ZEND_FE(oci_lob_is_equal, arginfo_oci_lob_is_equal)
663655
ZEND_FE(oci_lob_export, arginfo_oci_lob_export)
664-
ZEND_FE(oci_lob_write_temporary, arginfo_oci_lob_write_temporary)
665-
ZEND_FE(oci_lob_close, arginfo_oci_lob_close)
666656
ZEND_DEP_FALIAS(ociwritelobtofile, oci_lob_export, arginfo_ociwritelobtofile)
667657
ZEND_FE(oci_new_descriptor, arginfo_oci_new_descriptor)
668658
ZEND_DEP_FALIAS(ocinewdescriptor, oci_new_descriptor, arginfo_ocinewdescriptor)
@@ -781,8 +771,8 @@ static const zend_function_entry class_OCILob_methods[] = {
781771
ZEND_ME_MAPPING(getbuffering, ocigetbufferinglob, arginfo_class_OCILob_getbuffering, ZEND_ACC_PUBLIC)
782772
ZEND_ME_MAPPING(writetofile, oci_lob_export, arginfo_class_OCILob_writetofile, ZEND_ACC_PUBLIC)
783773
ZEND_ME_MAPPING(export, oci_lob_export, arginfo_class_OCILob_export, ZEND_ACC_PUBLIC)
784-
ZEND_ME_MAPPING(writetemporary, oci_lob_write_temporary, arginfo_class_OCILob_writetemporary, ZEND_ACC_PUBLIC)
785-
ZEND_ME_MAPPING(close, oci_lob_close, arginfo_class_OCILob_close, ZEND_ACC_PUBLIC)
774+
ZEND_ME(OCILob, writetemporary, arginfo_class_OCILob_writetemporary, ZEND_ACC_PUBLIC)
775+
ZEND_ME(OCILob, close, arginfo_class_OCILob_close, ZEND_ACC_PUBLIC)
786776
ZEND_ME_MAPPING(free, oci_free_descriptor, arginfo_class_OCILob_free, ZEND_ACC_PUBLIC)
787777
ZEND_FE_END
788778
};

ext/oci8/oci8_interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ PHP_FUNCTION(oci_lob_export)
916916
/* }}} */
917917

918918
/* {{{ Writes temporary blob */
919-
PHP_FUNCTION(oci_lob_write_temporary)
919+
PHP_METHOD(OCILob, writetemporary)
920920
{
921921
zval *tmp, *z_descriptor;
922922
php_oci_descriptor *descriptor;
@@ -943,7 +943,7 @@ PHP_FUNCTION(oci_lob_write_temporary)
943943
/* }}} */
944944

945945
/* {{{ Closes lob descriptor */
946-
PHP_FUNCTION(oci_lob_close)
946+
PHP_METHOD(OCILob, close)
947947
{
948948
zval *tmp, *z_descriptor;
949949
php_oci_descriptor *descriptor;

ext/xmlwriter/php_xmlwriter.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ class XMLWriter
9090
{
9191
/**
9292
* @return bool
93-
* @alias xmlwriter_open_uri
93+
* @static-method-alias xmlwriter_open_uri
9494
*/
95-
public static function openUri(string $uri) {}
95+
public function openUri(string $uri) {}
9696

9797
/**
9898
* @return bool
99-
* @alias xmlwriter_open_memory
99+
* @static-method-alias xmlwriter_open_memory
100100
*/
101101
public function openMemory() {}
102102

ext/xmlwriter/php_xmlwriter_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 1dac866f8b92d14862818a3350cc4f902c35dc65 */
2+
* Stub hash: 8607fe498af4c678f099231d52c3c8aabf5b7e9e */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0)
@@ -420,7 +420,7 @@ static const zend_function_entry ext_functions[] = {
420420

421421

422422
static const zend_function_entry class_XMLWriter_methods[] = {
423-
ZEND_ME_MAPPING(openUri, xmlwriter_open_uri, arginfo_class_XMLWriter_openUri, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
423+
ZEND_ME_MAPPING(openUri, xmlwriter_open_uri, arginfo_class_XMLWriter_openUri, ZEND_ACC_PUBLIC)
424424
ZEND_ME_MAPPING(openMemory, xmlwriter_open_memory, arginfo_class_XMLWriter_openMemory, ZEND_ACC_PUBLIC)
425425
ZEND_ME_MAPPING(setIndent, xmlwriter_set_indent, arginfo_class_XMLWriter_setIndent, ZEND_ACC_PUBLIC)
426426
ZEND_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, arginfo_class_XMLWriter_setIndentString, ZEND_ACC_PUBLIC)

0 commit comments

Comments
 (0)