Skip to content

Commit a9efcb1

Browse files
committed
gen_stub: Also verify implementation-alias
This makes --verify also check @implementation-alias. Failures are ignored using @no-verify instead. Some mistakes have been made that would have been caught by this... Closes GH-6615.
1 parent d340be0 commit a9efcb1

File tree

9 files changed

+19
-7
lines changed

9 files changed

+19
-7
lines changed

build/gen_stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ function initPhpParser() {
18811881
$errors = [];
18821882

18831883
foreach ($funcMap as $aliasFunc) {
1884-
if ($aliasFunc->aliasType !== "alias") {
1884+
if (!$aliasFunc->alias) {
18851885
continue;
18861886
}
18871887

ext/bz2/bz2.stub.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ function bzread($bz, int $length = 1024): string|false {}
1414
/**
1515
* @param resource $bz
1616
* @implementation-alias fwrite
17+
* @no-verify Uses different parameter name
1718
*/
1819
function bzwrite($bz, string $data, ?int $length = null): int|false {}
1920

2021
/**
2122
* @param resource $bz
2223
* @implementation-alias fflush
24+
* @no-verify Uses different parameter name
2325
*/
2426
function bzflush($bz): bool {}
2527

2628
/**
2729
* @param resource $bz
2830
* @implementation-alias fclose
31+
* @no-verify Uses different parameter name
2932
*/
3033
function bzclose($bz): bool {}
3134

ext/bz2/bz2_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 0cd7792480671883ebae30ae8358b8f8e3390474 */
2+
* Stub hash: 5436fd5a4b0fbfd3b3b3f1caa6a0cf8326c9c5f7 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_bzopen, 0, 0, 2)
55
ZEND_ARG_INFO(0, file)

ext/phar/phar_object.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ final public static function webPhar(
180180

181181
class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAccess
182182
{
183-
/** @implementation-alias Phar::__construct */
183+
/**
184+
* @implementation-alias Phar::__construct
185+
* @no-verify PharData constructor accepts extra $format argument
186+
*/
184187
public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, int $format = 0) {}
185188

186189
/** @implementation-alias Phar::__destruct */

ext/phar/phar_object_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 3575a0330ff6102461655bc84add44e8b08b585f */
2+
* Stub hash: 96900fb403c625ad76b86bac37aed65722472f84 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)

ext/spl/spl_observer.stub.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function serialize() {}
7474
* @param object $object
7575
* @return bool
7676
* @implementation-alias SplObjectStorage::contains
77+
* @no-verify Cannot specify arg type because ArrayAccess does not
7778
*/
7879
public function offsetExists($object) {}
7980

@@ -87,13 +88,15 @@ public function offsetGet($object) {}
8788
* @param object $object
8889
* @return void
8990
* @implementation-alias SplObjectStorage::attach
91+
* @no-verify Cannot specify arg type because ArrayAccess does not
9092
*/
9193
public function offsetSet($object, mixed $info = null) {}
9294

9395
/**
9496
* @param object $object
9597
* @return void
9698
* @implementation-alias SplObjectStorage::detach
99+
* @no-verify Cannot specify arg type because ArrayAccess does not
97100
*/
98101
public function offsetUnset($object) {}
99102

ext/spl/spl_observer_arginfo.h

Lines changed: 1 addition & 1 deletion
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: aaefa4d4ac3b795212191d9fe06982d29948f552 */
2+
* Stub hash: fdcb6eb431f6accdb8e44ecc735ae563a5651edf */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObserver_update, 0, 0, 1)
55
ZEND_ARG_OBJ_INFO(0, subject, SplSubject, 0)

ext/sqlite3/sqlite3.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
class SQLite3
66
{
7-
/** @implementation-alias SQLite3::open */
7+
/**
8+
* @implementation-alias SQLite3::open
9+
* @no-verify SQLite3::open should really be static
10+
*/
811
public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "") {}
912

1013
/** @return void */

ext/sqlite3/sqlite3_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 61a684b6c221a15538a5f8cc32bc4e7d4cf3c8fd */
2+
* Stub hash: 2abe77016e7a595f1687be34e52bba6aa477e7ae */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)

0 commit comments

Comments
 (0)