]> granicus.if.org Git - php/commitdiff
gen_stub: Also verify implementation-alias
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 18 Jan 2021 15:14:31 +0000 (16:14 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 19 Jan 2021 08:48:33 +0000 (09:48 +0100)
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.

build/gen_stub.php
ext/bz2/bz2.stub.php
ext/bz2/bz2_arginfo.h
ext/phar/phar_object.stub.php
ext/phar/phar_object_arginfo.h
ext/spl/spl_observer.stub.php
ext/spl/spl_observer_arginfo.h
ext/sqlite3/sqlite3.stub.php
ext/sqlite3/sqlite3_arginfo.h

index f231307f2aa9ae91280d8ec4b9f1b9d6cdaec80e..319446ef4118396d3a2e4de1a142f9c94adf87e1 100755 (executable)
@@ -1881,7 +1881,7 @@ if ($verify) {
     $errors = [];
 
     foreach ($funcMap as $aliasFunc) {
-        if ($aliasFunc->aliasType !== "alias") {
+        if (!$aliasFunc->alias) {
             continue;
         }
 
index ebedfea799ee8968d8626015791284cb84910969..90141e3b6c119f7010873e581abe9d05f43f51a6 100644 (file)
@@ -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 {}
 
index f3c2d86320e9cd27f2f32db4bbbfdeea3789a03a..78b8e88a92e960b31a3e73469bf1e346b71c19c4 100644 (file)
@@ -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)
index 31663e4b8c68798091a95c3a16298b18a62baf7f..13a00804ec7d12776f9794639c85f23ecaf99e70 100644 (file)
@@ -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 */
index dd4b8aba7590b4049f60fc606b8155657304d132..1e91c2f1a0a41f7b85708c1cf2eb4709c6ece050 100644 (file)
@@ -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)
index 6fcd3c4c69df2ad8e1d56c75428a01f5128bf7a7..b7b423e9841d7811d7672c914c72b17eca73cf3e 100644 (file)
@@ -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) {}
 
index db9b1d11251002bf80f34cc9887ab64fbb20b69a..f802c2a5a887d780274ddc83c7544bd040086b07 100644 (file)
@@ -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)
index 95bfb312d87efc754a27fe54da3d4125bd88ac50..b4d4fdce297ff622fec98f44bf7f2b1ae2f0c0d1 100644 (file)
@@ -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 */
index 39e026c52d5d8702453bdf240a6cd3a713ce6e4c..8f95c54d8fc9d618f7543b950e1c65cd507058cf 100644 (file)
@@ -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)