Skip to content

Commit 7aadcd9

Browse files
committed
Test fixes
1 parent 214dce8 commit 7aadcd9

File tree

2 files changed

+152
-95
lines changed

2 files changed

+152
-95
lines changed

ext/mysqli/mysqli.stub.php

Lines changed: 98 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function set_charset(?string $charset);
247247
*
248248
* @return bool
249249
*/
250-
public function options(?int $option, ?mixed $value);
250+
public function options(?int $option, $value);
251251

252252
/**
253253
* @param ?int $mysql_option
@@ -398,10 +398,6 @@ public function free_result();
398398

399399
class mysqli_stmt
400400
{
401-
/**
402-
* @param mysqli $mysqli_link
403-
* @param string $statement
404-
*/
405401
public function __construct(mysqli $mysqli_link, string $statement);
406402

407403
/**
@@ -425,14 +421,14 @@ public function attr_set(int $attr, int $mode_in);
425421
*
426422
* @return bool
427423
*/
428-
public function bind_param(string $types, mixed &...$vars);
424+
public function bind_param(string $types, &...$vars);
429425

430426
/**
431427
* @param mixed &...$vars
432428
*
433429
* @return bool
434430
*/
435-
public function bind_result(mixed &...$vars);
431+
public function bind_result(&...$vars);
436432

437433
/**
438434
* @return bool
@@ -521,21 +517,31 @@ class mysqli_sql_exception extends RuntimeException
521517
{
522518
}
523519

524-
function mysqli_affected_rows(mysqli $mysql_link): int {}
520+
function mysqli_affected_rows(mysqli $mysql_link): int|bool {}
525521

526522
function mysqli_autocommit(mysqli $mysql_link, bool $mode): bool {}
527523

528524
function mysqli_begin_transaction(mysqli $mysql_link, int $flags = 0, string $name = ''): bool {}
529525

530526
function mysqli_change_user(mysqli $mysql_link, string $user, string $password, ?string $database): bool {}
531527

532-
function mysqli_character_set_name(mysqli $mysql_link): string {}
528+
function mysqli_character_set_name(mysqli $mysql_link): string|bool {}
533529

534530
function mysqli_close(mysqli $mysql_link): bool {}
535531

536532
function mysqli_commit(mysqli $mysql_link, int $flags = 0, string $name = ''): bool {}
537533

538-
function mysqli_connect(?string $host = null, ?string $user = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null): mysqli {}
534+
/**
535+
* @param ?string $host
536+
* @param ?string $user
537+
* @param ?string $password
538+
* @param ?string $database
539+
* @param ?int $port
540+
* @param ?int $flags
541+
*
542+
* @return mysqli|bool
543+
*/
544+
function mysqli_connect(?string $host = null, ?string $user = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null) {}
539545

540546
function mysqli_connect_errno(): int {}
541547

@@ -547,9 +553,9 @@ function mysqli_dump_debug_info(mysqli $mysql_link): bool {}
547553

548554
function mysqli_debug(string $debug): bool {}
549555

550-
function mysqli_errno(mysqli $mysql_link): int {}
556+
function mysqli_errno(mysqli $mysql_link): int|bool {}
551557

552-
function mysqli_error(mysqli $mysql_link): string {}
558+
function mysqli_error(mysqli $mysql_link): string|bool {}
553559

554560
function mysqli_error_list(mysqli $mysql_link): array {}
555561

@@ -559,57 +565,57 @@ function mysqli_execute(mysqli_stmt $mysql_stmt): bool {}
559565

560566
function mysqli_fetch_field(mysqli_result $mysql_result): object|false {}
561567

562-
function mysqli_fetch_fields(mysqli_result $mysql_result): array {}
568+
function mysqli_fetch_fields(mysqli_result $mysql_result): array|bool {}
563569

564570
function mysqli_fetch_field_direct(mysqli_result $mysql_result, int $offset): object|false {}
565571

566572
function mysqli_fetch_lengths(mysqli_result $mysql_result): array|false {}
567573

568574
function mysqli_fetch_all(mysqli_result $mysql_result, int $mode = MYSQLI_NUM): array|false {}
569575

570-
function mysqli_fetch_array(mysqli_result $mysql_result, int $fetchtype = MYSQLI_BOTH): array|false {}
576+
function mysqli_fetch_array(mysqli_result $mysql_result, int $fetchtype = MYSQLI_BOTH): array|false|null {}
571577

572-
function mysqli_fetch_assoc(mysqli_result $mysql_result): array {}
578+
function mysqli_fetch_assoc(mysqli_result $mysql_result): array|bool|null {}
573579

574-
function mysqli_fetch_object(mysqli_result $mysqli_result, string $class_name = 'stdClass', array $params = []): object {}
580+
function mysqli_fetch_object(mysqli_result $mysqli_result, string $class_name = 'stdClass', array $params = []): object|bool|null {}
575581

576-
function mysqli_fetch_row(mysqli_result $mysqli_result): array {}
582+
function mysqli_fetch_row(mysqli_result $mysqli_result): array|bool|null {}
577583

578-
function mysqli_field_count(mysqli_result $mysqli_result): int {}
584+
function mysqli_field_count(mysqli $mysqli_link): int|bool {}
579585

580586
function mysqli_field_seek(mysqli_result $mysqli_result, int $field_nr): bool {}
581587

582-
function mysqli_field_tell(mysqli_result $mysqli_result): int {}
588+
function mysqli_field_tell(mysqli_result $mysqli_result): int|bool {}
583589

584590
function mysqli_free_result(mysqli_result $mysqli_result): void {}
585591

586592
function mysqli_get_connection_stats(mysqli $mysqli_link): array {}
587593

588-
function mysqli_get_client_stats(mysqli $mysqli_link): array {}
594+
function mysqli_get_client_stats(): array {}
589595

590-
function mysqli_get_charset(mysqli $mysqli_link): object {}
596+
function mysqli_get_charset(mysqli $mysqli_link): object|bool {}
591597

592598
function mysqli_get_client_info(): string {}
593599

594600
function mysqli_get_client_version(): int {}
595601

596602
function mysqli_get_links_stats(mysqli $mysqli_link): array {}
597603

598-
function mysqli_get_host_info(mysqli $mysqli_link): string {}
604+
function mysqli_get_host_info(mysqli $mysqli_link): string|bool {}
599605

600-
function mysqli_get_proto_info(mysqli $mysqli_link): int {}
606+
function mysqli_get_proto_info(mysqli $mysqli_link): int|bool {}
601607

602-
function mysqli_get_server_info(mysqli $mysqli_link): string {}
608+
function mysqli_get_server_info(mysqli $mysqli_link): string|bool {}
603609

604-
function mysqli_get_server_version(mysqli $mysqli_link): int {}
610+
function mysqli_get_server_version(mysqli $mysqli_link): int|bool {}
605611

606612
function mysqli_get_warnings(mysqli $mysqli_link): mysqli_warning {}
607613

608614
function mysqli_init(): mysqli {}
609615

610-
function mysqli_info(mysqli $mysqli_link): string {}
616+
function mysqli_info(mysqli $mysqli_link): string|bool|null {}
611617

612-
function mysqli_insert_id(mysqli $mysqli_link): int|string {}
618+
function mysqli_insert_id(mysqli $mysqli_link): int|bool|string {}
613619

614620
function mysqli_kill(mysqli $mysqli_link, int $processid): bool {}
615621

@@ -619,15 +625,22 @@ function mysqli_multi_query(mysqli $mysqli_link, string $query): bool {}
619625

620626
function mysqli_next_result(mysqli $mysqli_link): bool {}
621627

622-
function mysqli_num_fields(mysqli $mysqli_link): int {}
628+
function mysqli_num_fields(mysqli_result $mysql_result): int|bool {}
623629

624-
function mysqli_num_rows(mysqli $mysqli_link): int|string {}
630+
function mysqli_num_rows(mysqli_result $mysqli_result): int|string|bool {}
625631

626-
function mysqli_options(mysqli $mysqli_link, int $mysql_option, mixed $mysql_value): bool {}
632+
/**
633+
* @param mysqli $mysqli_link
634+
* @param int $mysql_option
635+
* @param mixed $mysql_value
636+
*
637+
* @return bool
638+
*/
639+
function mysqli_options(mysqli $mysqli_link, int $mysql_option, $mysql_value): bool {}
627640

628641
function mysqli_ping(mysqli $mysqli_link): bool {}
629642

630-
function mysqli_poll(?array &$read, ?array &$write, ?array &$error, int $sec, int $usec = 0): int {}
643+
function mysqli_poll(?array &$read, ?array &$write, ?array &$error, int $sec, int $usec = 0): int|bool {}
631644

632645
/**
633646
* @param mysqli $mysqli_link
@@ -648,9 +661,20 @@ function mysqli_report(int $flags): bool {}
648661
*/
649662
function mysqli_query(mysqli $mysqli_link, string $query, int $resultmode = MYSQLI_STORE_RESULT) {}
650663

651-
function mysqli_real_connect(mysqli $mysqli_link, ?string $host = null, ?string $user = null, ?string $password = null, ?string $database = null, ?int $port = null, ?int $flags = null): mysqli {}
664+
/**
665+
* @param mysqli $mysqli_link
666+
* @param ?string $host
667+
* @param ?string $user
668+
* @param ?string $password
669+
* @param ?string $database
670+
* @param ?int $port
671+
* @param ?int $flags
672+
*
673+
* @return mysqli|bool
674+
*/
675+
function mysqli_real_connect(mysqli $mysqli_link, ?string $host = null, ?string $user = null, ?string $password = null, ?string $database = null, ?int $port = null, ?int $flags = null) {}
652676

653-
function mysqli_real_escape_string(mysqli $mysqli_link, string $escapestr): string {}
677+
function mysqli_real_escape_string(mysqli $mysqli_link, string $escapestr): string|bool {}
654678

655679
function mysqli_real_query(mysqli $mysqli_link, string $query): bool {}
656680

@@ -671,15 +695,28 @@ function mysqli_select_db(mysqli $mysqli_link, string $dbname): bool {}
671695

672696
function mysqli_set_charset(mysqli $mysqli_link, string $cs_name): bool {}
673697

674-
function mysqli_stmt_affected_rows(mysqli_stmt $mysql_stmt): int {}
698+
function mysqli_stmt_affected_rows(mysqli_stmt $mysql_stmt): int|bool {}
675699

676700
function mysqli_stmt_attr_get(mysqli_stmt $mysql_stmt, int $attr): int|false {}
677701

678702
function mysqli_stmt_attr_set(mysqli_stmt $mysql_stmt, int $attr, int $mode_in): bool {}
679703

680-
function mysqli_stmt_bind_param(mysqli_stmt $mysql_stmt, string $types, mixed &...$vars): bool {}
704+
/**
705+
* @param mysqli_stmt $mysql_stmt
706+
* @param string $types
707+
* @param mixed &...$vars
708+
*
709+
* @return bool
710+
*/
711+
function mysqli_stmt_bind_param(mysqli_stmt $mysql_stmt, string $types, &...$vars): bool {}
681712

682-
function mysqli_stmt_bind_result(mysqli_stmt $mysql_stmt, mixed &...$vars): bool {}
713+
/**
714+
* @param mysqli_stmt $mysql_stmt
715+
* @param mixed &...$vars
716+
*
717+
* @return bool
718+
*/
719+
function mysqli_stmt_bind_result(mysqli_stmt $mysql_stmt, &...$vars): bool {}
683720

684721
function mysqli_stmt_close(mysqli_stmt $mysql_stmt): bool {}
685722

@@ -691,15 +728,15 @@ function mysqli_stmt_close(mysqli_stmt $mysql_stmt): bool {}
691728
*/
692729
function mysqli_stmt_data_seek(mysqli_stmt $mysql_stmt, int $offset) {}
693730

694-
function mysqli_stmt_errno(mysqli_stmt $mysql_stmt): int {}
731+
function mysqli_stmt_errno(mysqli_stmt $mysql_stmt): int|bool {}
695732

696-
function mysqli_stmt_error(mysqli_stmt $mysql_stmt): string {}
733+
function mysqli_stmt_error(mysqli_stmt $mysql_stmt): string|bool {}
697734

698735
function mysqli_stmt_error_list(mysqli_stmt $mysql_stmt): array {}
699736

700-
function mysqli_stmt_fetch(mysqli_stmt $mysql_stmt): bool {}
737+
function mysqli_stmt_fetch(mysqli_stmt $mysql_stmt): bool|null {}
701738

702-
function mysqli_stmt_field_count(mysqli_stmt $mysql_stmt): int {}
739+
function mysqli_stmt_field_count(mysqli_stmt $mysql_stmt): int|bool {}
703740

704741
function mysqli_stmt_free_result(mysqli_stmt $mysql_stmt): void {}
705742

@@ -710,7 +747,12 @@ function mysqli_stmt_free_result(mysqli_stmt $mysql_stmt): void {}
710747
*/
711748
function mysqli_stmt_get_result(mysqli_stmt $mysql_stmt) {}
712749

713-
function mysqli_stmt_get_warnings(mysqli_stmt $mysql_stmt): mysqli_warning {}
750+
/**
751+
* @param mysqli_stmt $mysql_stmt
752+
*
753+
* @return mysqli_warning|bool
754+
*/
755+
function mysqli_stmt_get_warnings(mysqli_stmt $mysql_stmt) {}
714756

715757
/**
716758
* @param mysqli $mysql_link
@@ -719,15 +761,15 @@ function mysqli_stmt_get_warnings(mysqli_stmt $mysql_stmt): mysqli_warning {}
719761
*/
720762
function mysqli_stmt_init(mysqli $mysql_link) {}
721763

722-
function mysqli_stmt_insert_id(mysqli_stmt $mysql_stmt): int {}
764+
function mysqli_stmt_insert_id(mysqli_stmt $mysql_stmt): int|bool {}
723765

724766
function mysqli_stmt_more_results(mysqli_stmt $mysql_stmt): bool {}
725767

726768
function mysqli_stmt_next_result(mysqli_stmt $mysql_stmt): bool {}
727769

728-
function mysqli_stmt_num_rows(mysqli_stmt $mysql_stmt): int {}
770+
function mysqli_stmt_num_rows(mysqli_stmt $mysql_stmt): int|bool {}
729771

730-
function mysqli_stmt_param_count(mysqli_stmt $mysql_stmt): int {}
772+
function mysqli_stmt_param_count(mysqli_stmt $mysql_stmt): int|bool {}
731773

732774
function mysqli_stmt_prepare(mysqli_stmt $mysql_stmt, string $query): bool {}
733775

@@ -744,9 +786,9 @@ function mysqli_stmt_send_long_data(mysqli_stmt $mysql_stmt, int $param_nr, stri
744786

745787
function mysqli_stmt_store_result(mysqli_stmt $mysql_stmt): bool {}
746788

747-
function mysqli_stmt_sqlstate(mysqli_stmt $mysql_stmt): string {}
789+
function mysqli_stmt_sqlstate(mysqli_stmt $mysql_stmt): string|bool {}
748790

749-
function mysqli_sqlstate(mysqli $mysqli_link): string {}
791+
function mysqli_sqlstate(mysqli $mysqli_link): string|bool {}
750792

751793
function mysqli_ssl_set(mysqli $mysql_link, string $key, string $cert, string $certificate_authority, string $certificate_authority_path, string $cipher): bool {}
752794

@@ -760,7 +802,7 @@ function mysqli_stat(mysqli $mysql_link): string|false {}
760802
*/
761803
function mysqli_store_result(mysqli $mysql_link, int $flags = 0) {}
762804

763-
function mysqli_thread_id(mysqli $mysql_link): int {}
805+
function mysqli_thread_id(mysqli $mysql_link): int|bool {}
764806

765807
function mysqli_thread_safe(): bool {}
766808

@@ -771,10 +813,17 @@ function mysqli_thread_safe(): bool {}
771813
*/
772814
function mysqli_use_result(mysqli $mysql_link) {}
773815

774-
function mysqli_warning_count(mysqli $mysql_link): int {}
816+
function mysqli_warning_count(mysqli $mysql_link): int|bool {}
775817

776818
function mysqli_refresh(mysqli $mysqli_link, int $options): bool {}
777819

778820
function mysqli_escape_string(mysqli $mysqli_link, string $escapestr): string {}
779821

780-
function mysqli_set_opt(mysqli $mysqli_link, int $mysql_option, mixed $mysql_value): bool {}
822+
/**
823+
* @param mysqli $mysqli_link
824+
* @param int $mysql_option
825+
* @param mixed $mysql_value
826+
*
827+
* @return bool
828+
*/
829+
function mysqli_set_opt(mysqli $mysqli_link, int $mysql_option, $mysql_value): bool {}

0 commit comments

Comments
 (0)