Skip to content

Commit

Permalink
Fix mysqli stub alias verification issues
Browse files Browse the repository at this point in the history
I had to add a few no-verify annotations since the return type of the function and method counterparts cannot be aligned properly (easily)
  • Loading branch information
kocsismate committed Aug 26, 2021
1 parent 17ccabc commit 7d3cdb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ext/mysqli/mysqli.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public function character_set_name(): string {}
/**
* @return true
* @alias mysqli_close
* @no-verify
*/
public function close() {} // TODO make return type void

Expand Down Expand Up @@ -301,6 +302,7 @@ public function set_opt(int $option, $value): bool {}
/**
* @return true
* @alias mysqli_ssl_set
* @no-verify
*/
public function ssl_set(
?string $key,
Expand Down Expand Up @@ -386,6 +388,7 @@ public function data_seek(int $offset): bool {}
public function fetch_field(): object|false {}

/**
* @return array<int, object>
* @tentative-return-type
* @alias mysqli_fetch_fields
*/
Expand Down Expand Up @@ -422,6 +425,7 @@ public function fetch_assoc(): array|null|false {}
public function fetch_object(string $class = "stdClass", array $constructor_args = []): object|null|false {}

/**
* @return array<int, mixed>|null|false
* @tentative-return-type
* @alias mysqli_fetch_row
*/
Expand Down Expand Up @@ -496,6 +500,7 @@ public function bind_result(mixed &...$vars): bool {}
/**
* @return true
* @alias mysqli_stmt_close
* @no-verify
*/
public function close() {} // TODO make return type void

Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/mysqli_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: aca86b9ae21b5ac8043e5bd9f3aee364c7b1bb1f */
* Stub hash: 11628afb5c66778bfd89890fdf182947383e59c1 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
Expand Down

0 comments on commit 7d3cdb3

Please sign in to comment.