From f4e686d6a215da3460661c73d61cf451bc158cb5 Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Sat, 4 Jan 2025 22:22:10 -0300 Subject: [PATCH 1/7] wp_register_script() parameters definition has changed in WP 6.3 --- stubs/WordPress/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index a298a89..113d5d3 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1614,11 +1614,11 @@ function wp_rand( $min = 0, $max = 0 ) { * @param string|bool $src * @param array $deps * @param string|bool|null $ver - * @param bool $in_footer + * @param array|bool $args * * @return bool */ -function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { +function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args = array() ) { } /** From 9fad97ed429719328d5e29e54359c4c4dcf0b730 Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Sat, 4 Jan 2025 22:33:43 -0300 Subject: [PATCH 2/7] proper wp_register_script() array typint in phpdoc --- stubs/WordPress/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index 113d5d3..23d0516 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1610,11 +1610,11 @@ function wp_rand( $min = 0, $max = 0 ) { } /** - * @param string $handle - * @param string|bool $src - * @param array $deps - * @param string|bool|null $ver - * @param array|bool $args + * @param string $handle + * @param string|bool $src + * @param array $deps + * @param string|bool|null $ver + * @param array|bool $args * * @return bool */ From 610098f15d509eff0b3682dfc3217183a925d0bf Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Sun, 5 Jan 2025 17:59:10 -0300 Subject: [PATCH 3/7] wp_register_script() parameter definition with brackets --- stubs/WordPress/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index 23d0516..903c2f0 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1614,7 +1614,7 @@ function wp_rand( $min = 0, $max = 0 ) { * @param string|bool $src * @param array $deps * @param string|bool|null $ver - * @param array|bool $args + * @param array{string, string|bool}|bool $args * * @return bool */ From 115b6296a5926dfab30dfe97b4fff6c2dd5029a3 Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Sun, 5 Jan 2025 19:44:16 -0300 Subject: [PATCH 4/7] array definition for wp_register_script() --- stubs/WordPress/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index 903c2f0..375fdc0 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1614,7 +1614,7 @@ function wp_rand( $min = 0, $max = 0 ) { * @param string|bool $src * @param array $deps * @param string|bool|null $ver - * @param array{string, string|bool}|bool $args + * @param array{0:string, 1:string|bool}|bool $args * * @return bool */ From 8c034f38f1069abda22feb1643e27ebd2789bc9f Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Sun, 5 Jan 2025 19:46:09 -0300 Subject: [PATCH 5/7] wp_register_script() adding spaces --- stubs/WordPress/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index 375fdc0..b7e270b 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1614,7 +1614,7 @@ function wp_rand( $min = 0, $max = 0 ) { * @param string|bool $src * @param array $deps * @param string|bool|null $ver - * @param array{0:string, 1:string|bool}|bool $args + * @param array{0: string, 1: string|bool}|bool $args * * @return bool */ From dd2d885c9d2c51b4a7380d91dddf3648f7c252b0 Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Mon, 6 Jan 2025 00:50:49 -0300 Subject: [PATCH 6/7] fixed spaces --- stubs/WordPress/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index b7e270b..dfe9aff 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1610,10 +1610,10 @@ function wp_rand( $min = 0, $max = 0 ) { } /** - * @param string $handle - * @param string|bool $src - * @param array $deps - * @param string|bool|null $ver + * @param string $handle + * @param string|bool $src + * @param array $deps + * @param string|bool|null $ver * @param array{0: string, 1: string|bool}|bool $args * * @return bool From be07fe445d398f85ba5ac1dcd66595dc8c5c8672 Mon Sep 17 00:00:00 2001 From: jcvignoli Date: Mon, 6 Jan 2025 10:32:09 -0300 Subject: [PATCH 7/7] wp_register_script() better definition of array in phpdoc --- stubs/WordPress/functions.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index dfe9aff..03a628c 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -1610,11 +1610,14 @@ function wp_rand( $min = 0, $max = 0 ) { } /** - * @param string $handle - * @param string|bool $src - * @param array $deps - * @param string|bool|null $ver - * @param array{0: string, 1: string|bool}|bool $args + * @param string $handle + * @param string|bool $src + * @param array $deps + * @param string|bool|null $ver + * @param bool|array{strategy?: string, in_footer?: bool} $args { + * @type string $strategy + * @type bool $in_footer + * } * * @return bool */