summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-18 16:14:31 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-19 09:48:33 +0100
commita9efcb1561a10bf0324f23c0f30b9447aa753a47 (patch)
treef1c651ce39243ecc29e8703f4428e77686f692b8
parentd340be0d3246542c1ae34d632f36510fb1792852 (diff)
downloadphp-git-a9efcb1561a10bf0324f23c0f30b9447aa753a47.tar.gz
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.
-rwxr-xr-xbuild/gen_stub.php2
-rw-r--r--ext/bz2/bz2.stub.php3
-rw-r--r--ext/bz2/bz2_arginfo.h2
-rw-r--r--ext/phar/phar_object.stub.php5
-rw-r--r--ext/phar/phar_object_arginfo.h2
-rw-r--r--ext/spl/spl_observer.stub.php3
-rw-r--r--ext/spl/spl_observer_arginfo.h2
-rw-r--r--ext/sqlite3/sqlite3.stub.php5
-rw-r--r--ext/sqlite3/sqlite3_arginfo.h2
9 files changed, 19 insertions, 7 deletions
diff --git a/build/gen_stub.php b/build/gen_stub.php
index f231307f2a..319446ef41 100755
--- a/build/gen_stub.php
+++ b/build/gen_stub.php
@@ -1881,7 +1881,7 @@ if ($verify) {
$errors = [];
foreach ($funcMap as $aliasFunc) {
- if ($aliasFunc->aliasType !== "alias") {
+ if (!$aliasFunc->alias) {
continue;
}
diff --git a/ext/bz2/bz2.stub.php b/ext/bz2/bz2.stub.php
index ebedfea799..90141e3b6c 100644
--- a/ext/bz2/bz2.stub.php
+++ b/ext/bz2/bz2.stub.php
@@ -14,18 +14,21 @@ function bzread($bz, int $length = 1024): string|false {}
/**
* @param resource $bz
* @implementation-alias fwrite
+ * @no-verify Uses different parameter name
*/
function bzwrite($bz, string $data, ?int $length = null): int|false {}
/**
* @param resource $bz
* @implementation-alias fflush
+ * @no-verify Uses different parameter name
*/
function bzflush($bz): bool {}
/**
* @param resource $bz
* @implementation-alias fclose
+ * @no-verify Uses different parameter name
*/
function bzclose($bz): bool {}
diff --git a/ext/bz2/bz2_arginfo.h b/ext/bz2/bz2_arginfo.h
index f3c2d86320..78b8e88a92 100644
--- a/ext/bz2/bz2_arginfo.h
+++ b/ext/bz2/bz2_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 0cd7792480671883ebae30ae8358b8f8e3390474 */
+ * Stub hash: 5436fd5a4b0fbfd3b3b3f1caa6a0cf8326c9c5f7 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_bzopen, 0, 0, 2)
ZEND_ARG_INFO(0, file)
diff --git a/ext/phar/phar_object.stub.php b/ext/phar/phar_object.stub.php
index 31663e4b8c..13a00804ec 100644
--- a/ext/phar/phar_object.stub.php
+++ b/ext/phar/phar_object.stub.php
@@ -180,7 +180,10 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAccess
{
- /** @implementation-alias Phar::__construct */
+ /**
+ * @implementation-alias Phar::__construct
+ * @no-verify PharData constructor accepts extra $format argument
+ */
public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, int $format = 0) {}
/** @implementation-alias Phar::__destruct */
diff --git a/ext/phar/phar_object_arginfo.h b/ext/phar/phar_object_arginfo.h
index dd4b8aba75..1e91c2f1a0 100644
--- a/ext/phar/phar_object_arginfo.h
+++ b/ext/phar/phar_object_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3575a0330ff6102461655bc84add44e8b08b585f */
+ * Stub hash: 96900fb403c625ad76b86bac37aed65722472f84 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
diff --git a/ext/spl/spl_observer.stub.php b/ext/spl/spl_observer.stub.php
index 6fcd3c4c69..b7b423e984 100644
--- a/ext/spl/spl_observer.stub.php
+++ b/ext/spl/spl_observer.stub.php
@@ -74,6 +74,7 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
* @param object $object
* @return bool
* @implementation-alias SplObjectStorage::contains
+ * @no-verify Cannot specify arg type because ArrayAccess does not
*/
public function offsetExists($object) {}
@@ -87,6 +88,7 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
* @param object $object
* @return void
* @implementation-alias SplObjectStorage::attach
+ * @no-verify Cannot specify arg type because ArrayAccess does not
*/
public function offsetSet($object, mixed $info = null) {}
@@ -94,6 +96,7 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
* @param object $object
* @return void
* @implementation-alias SplObjectStorage::detach
+ * @no-verify Cannot specify arg type because ArrayAccess does not
*/
public function offsetUnset($object) {}
diff --git a/ext/spl/spl_observer_arginfo.h b/ext/spl/spl_observer_arginfo.h
index db9b1d1125..f802c2a5a8 100644
--- a/ext/spl/spl_observer_arginfo.h
+++ b/ext/spl/spl_observer_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: aaefa4d4ac3b795212191d9fe06982d29948f552 */
+ * Stub hash: fdcb6eb431f6accdb8e44ecc735ae563a5651edf */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObserver_update, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, subject, SplSubject, 0)
diff --git a/ext/sqlite3/sqlite3.stub.php b/ext/sqlite3/sqlite3.stub.php
index 95bfb312d8..b4d4fdce29 100644
--- a/ext/sqlite3/sqlite3.stub.php
+++ b/ext/sqlite3/sqlite3.stub.php
@@ -4,7 +4,10 @@
class SQLite3
{
- /** @implementation-alias SQLite3::open */
+ /**
+ * @implementation-alias SQLite3::open
+ * @no-verify SQLite3::open should really be static
+ */
public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "") {}
/** @return void */
diff --git a/ext/sqlite3/sqlite3_arginfo.h b/ext/sqlite3/sqlite3_arginfo.h
index 39e026c52d..8f95c54d8f 100644
--- a/ext/sqlite3/sqlite3_arginfo.h
+++ b/ext/sqlite3/sqlite3_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 61a684b6c221a15538a5f8cc32bc4e7d4cf3c8fd */
+ * Stub hash: 2abe77016e7a595f1687be34e52bba6aa477e7ae */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)