From 95be71f2141fea57e05a4017cf5ffaef5788191c Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Thu, 8 May 2025 00:26:00 +0200 Subject: [PATCH 1/7] Empty string is the default value of callable (#289) --- functionMap.php | 12 ++++++++++++ wordpress-stubs.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/functionMap.php b/functionMap.php index 5ae0f588..d72048db 100644 --- a/functionMap.php +++ b/functionMap.php @@ -39,7 +39,19 @@ '_get_list_table' => ["(\$class_name is 'WP_Posts_List_Table'|'WP_Media_List_Table'|'WP_Terms_List_Table'|'WP_Users_List_Table'|'WP_Comments_List_Table'|'WP_Post_Comments_List_Table'|'WP_Links_List_Table'|'WP_Plugin_Install_List_Table'|'WP_Themes_List_Table'|'WP_Theme_Install_List_Table'|'WP_Plugins_List_Table'|'WP_Application_Passwords_List_Table'|'WP_MS_Sites_List_Table'|'WP_MS_Users_List_Table'|'WP_MS_Themes_List_Table'|'WP_Privacy_Data_Export_Requests_List_Table'|'WP_Privacy_Data_Removal_Requests_List_Table' ? new : false)", '@phpstan-template T' => 'of string', 'class_name' => 'T', 'args' => 'array{screen?: string}'], 'absint' => ['($maybeint is T&int<0, max> ? T : ($maybeint is int ? int<1, max> : ($maybeint is empty ? 0 : ($maybeint is numeric-string ? int<0, max> : ($maybeint is string ? 0 : ($maybeint is true|non-empty-array ? 1 : ($maybeint is bool ? 0|1 : int<0, max>)))))))', '@phpstan-template T' => 'of int', 'maybeint' => 'T|scalar|array|resource|null'], 'addslashes_gpc' => ['T', '@phpstan-template' => 'T', 'gpc' => 'T'], + 'add_menu_page' => [null, 'callback' => "''|callable"], + 'add_links_page' => [null, 'callback' => "''|callable"], + 'add_media_page' => [null, 'callback' => "''|callable"], + 'add_pages_page' => [null, 'callback' => "''|callable"], + 'add_posts_page' => [null, 'callback' => "''|callable"], + 'add_theme_page' => [null, 'callback' => "''|callable"], + 'add_users_page' => [null, 'callback' => "''|callable"], + 'add_options_page' => [null, 'callback' => "''|callable"], + 'add_plugins_page' => [null, 'callback' => "''|callable"], 'add_submenu_page' => [null, 'callback' => "''|callable"], + 'add_comments_page' => [null, 'callback' => "''|callable"], + 'add_dashboard_page' => [null, 'callback' => "''|callable"], + 'add_management_page' => [null, 'callback' => "''|callable"], 'bool_from_yn' => ["(\$yn is 'y' ? true : false)"], 'have_posts' => [null, '@phpstan-impure' => ''], 'is_new_day' => ['0|1'], diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 39522cf5..fac7ccb7 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -87838,6 +87838,7 @@ function uninstall_plugin($plugin) * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS. * @param int|float $position Optional. The position in the menu order this item should appear. * @return string The resulting page's hook_suffix. + * @phpstan-param ''|callable $callback */ function add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '', $position = \null) { @@ -87897,6 +87898,7 @@ function add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $ * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_management_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87920,6 +87922,7 @@ function add_management_page($page_title, $menu_title, $capability, $menu_slug, * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_options_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87943,6 +87946,7 @@ function add_options_page($page_title, $menu_title, $capability, $menu_slug, $ca * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_theme_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87966,6 +87970,7 @@ function add_theme_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_plugins_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87989,6 +87994,7 @@ function add_plugins_page($page_title, $menu_title, $capability, $menu_slug, $ca * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_users_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88012,6 +88018,7 @@ function add_users_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_dashboard_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88035,6 +88042,7 @@ function add_dashboard_page($page_title, $menu_title, $capability, $menu_slug, $ * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_posts_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88058,6 +88066,7 @@ function add_posts_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_media_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88081,6 +88090,7 @@ function add_media_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_links_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88104,6 +88114,7 @@ function add_links_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_pages_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88127,6 +88138,7 @@ function add_pages_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_comments_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { From 0358641b862c4716a11ee5b0fddd713d4d750d7a Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Thu, 8 May 2025 06:45:52 +0200 Subject: [PATCH 2/7] Add test data for have_posts (#290) --- tests/TypeInferenceTest.php | 1 + tests/data/have_posts.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/data/have_posts.php diff --git a/tests/TypeInferenceTest.php b/tests/TypeInferenceTest.php index 1b82760a..510760bd 100644 --- a/tests/TypeInferenceTest.php +++ b/tests/TypeInferenceTest.php @@ -43,6 +43,7 @@ public function dataFileAsserts(): iterable yield from $this->gatherAssertTypes(__DIR__ . '/data/get_user.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/get_user_by.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/has_filter.php'); + yield from $this->gatherAssertTypes(__DIR__ . '/data/have_posts.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/is_new_day.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/is_wp_error.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/mysql2date.php'); diff --git a/tests/data/have_posts.php b/tests/data/have_posts.php new file mode 100644 index 00000000..d3cf599d --- /dev/null +++ b/tests/data/have_posts.php @@ -0,0 +1,18 @@ + Date: Mon, 2 Jun 2025 23:32:08 +0200 Subject: [PATCH 3/7] Remove attribute hotfix from Visitor (#285) --- src/Visitor.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Visitor.php b/src/Visitor.php index 386000e9..ab7434af 100644 --- a/src/Visitor.php +++ b/src/Visitor.php @@ -72,10 +72,6 @@ public function enterNode(Node $node) parent::enterNode($node); - if ($node instanceof Node\Param) { - $node->attrGroups = []; - } - if (! ($node instanceof Function_) && ! ($node instanceof ClassMethod) && ! ($node instanceof Property) && ! ($node instanceof Class_)) { return null; } From 19888cac52ca270a73a5cab3a2dc1fb31cf16736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 2 Jun 2025 23:34:49 +0200 Subject: [PATCH 4/7] Bump nikic/php-parser (#291) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 368be2eb..43c92a08 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "require-dev": { "php": "^7.4 || ^8.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "nikic/php-parser": "^5.4", + "nikic/php-parser": "^5.5", "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.4.1", "phpstan/phpstan": "^2.1", From b73f28140a6f2a8a8ed35612da5bcf3ae0e18c32 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 2 Jun 2025 21:37:46 +0000 Subject: [PATCH 5/7] Update WordPress stubs --- wordpress-stubs.php | 229 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 196 insertions(+), 33 deletions(-) diff --git a/wordpress-stubs.php b/wordpress-stubs.php index fac7ccb7..59a54c13 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -7339,7 +7339,13 @@ public function cmpr_strlen($a, $b) * @param bool $head * @return array */ - public function get_page($url, $username = '', $password = '', $head = \false) + public function get_page( + $url, + $username = '', + #[\SensitiveParameter] + $password = '', + $head = \false + ) { } /** @@ -30024,7 +30030,10 @@ protected static function set_user_application_passwords($user_id, $passwords) * @param string $raw_password The raw application password. * @return string The chunked password. */ - public static function chunk_password($raw_password) + public static function chunk_password( + #[\SensitiveParameter] + $raw_password + ) { } /** @@ -30035,7 +30044,10 @@ public static function chunk_password($raw_password) * @param string $password Plaintext password. * @return string Hashed password. */ - public static function hash_password(string $password): string + public static function hash_password( + #[\SensitiveParameter] + string $password + ): string { } /** @@ -30047,7 +30059,11 @@ public static function hash_password(string $password): string * @param string $hash Hash of the password to check against. * @return bool Whether the password matches the hashed password. */ - public static function check_password(string $password, string $hash): bool + public static function check_password( + #[\SensitiveParameter] + string $password, + string $hash + ): bool { } } @@ -55577,7 +55593,11 @@ public function addTwoNumbers($args) * @param string $password User's password. * @return WP_User|false WP_User object if authentication passed, false otherwise. */ - public function login($username, $password) + public function login( + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -55591,7 +55611,11 @@ public function login($username, $password) * @param string $password User's password. * @return bool Whether authentication passed. */ - public function login_pass_ok($username, $password) + public function login_pass_ok( + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -58603,7 +58627,13 @@ class wpdb * @param string $dbhost Database host. * @phpstan-return void */ - public function __construct($dbuser, $dbpassword, $dbname, $dbhost) + public function __construct( + $dbuser, + #[\SensitiveParameter] + $dbpassword, + $dbname, + $dbhost + ) { } /** @@ -77308,7 +77338,12 @@ public function check_username($value, $request, $param) * @param string $param The parameter name. * @return string|WP_Error The sanitized password, if valid, otherwise an error. */ - public function check_user_password($value, $request, $param) + public function check_user_password( + #[\SensitiveParameter] + $value, + $request, + $param + ) { } /** @@ -91393,7 +91428,16 @@ function wp_get_auto_update_message() * password_message: string, * } */ - function wp_install($blog_title, $user_name, $user_email, $is_public, $deprecated = '', $user_password = '', $language = '') + function wp_install( + $blog_title, + $user_name, + $user_email, + $is_public, + $deprecated = '', + #[\SensitiveParameter] + $user_password = '', + $language = '' + ) { } /** @@ -91441,7 +91485,13 @@ function wp_install_maybe_enable_pretty_permalinks() * @param string $password Administrator's password. Note that a placeholder message is * usually passed instead of the actual password. */ - function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) + function wp_new_blog_notification( + $blog_title, + $blog_url, + $user_id, + #[\SensitiveParameter] + $password + ) { } /** @@ -114245,7 +114295,10 @@ function wp_is_heic_image_mime_type($mime_type) * @param string $message The message to hash. * @return string The hash of the message. */ - function wp_fast_hash(string $message): string + function wp_fast_hash( + #[\SensitiveParameter] + string $message + ): string { } /** @@ -114263,7 +114316,11 @@ function wp_fast_hash(string $message): string * @param string $hash Hash of the message to check against. * @return bool Whether the message matches the hashed message. */ - function wp_verify_fast_hash(string $message, string $hash): bool + function wp_verify_fast_hash( + #[\SensitiveParameter] + string $message, + string $hash + ): bool { } /** @@ -125337,7 +125394,16 @@ function wpmu_signup_user($user, $user_email, $meta = array()) * @param array $meta Optional. Signup meta data. By default, contains the requested privacy setting and lang_id. * @return bool */ - function wpmu_signup_blog_notification($domain, $path, $title, $user_login, $user_email, $key, $meta = array()) + function wpmu_signup_blog_notification( + $domain, + $path, + $title, + $user_login, + $user_email, + #[\SensitiveParameter] + $key, + $meta = array() + ) { } /** @@ -125362,7 +125428,13 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user_login, $use * @param array $meta Optional. Signup meta data. Default empty array. * @return bool */ - function wpmu_signup_user_notification($user_login, $user_email, $key, $meta = array()) + function wpmu_signup_user_notification( + $user_login, + $user_email, + #[\SensitiveParameter] + $key, + $meta = array() + ) { } /** @@ -125380,7 +125452,10 @@ function wpmu_signup_user_notification($user_login, $user_email, $key, $meta = a * @param string $key The activation key provided to the user. * @return array|WP_Error An array containing information about the activated user and/or blog. */ - function wpmu_activate_signup($key) + function wpmu_activate_signup( + #[\SensitiveParameter] + $key + ) { } /** @@ -125412,7 +125487,12 @@ function wp_delete_signup_on_user_delete($id, $reassign, $user) * @param string $email The new user's email address. * @return int|false Returns false on failure, or int $user_id on success. */ - function wpmu_create_user($user_name, $password, $email) + function wpmu_create_user( + $user_name, + #[\SensitiveParameter] + $password, + $email + ) { } /** @@ -125512,7 +125592,14 @@ function domain_exists($domain, $path, $network_id = 1) * @param array $meta Optional. Signup meta data. By default, contains the requested privacy setting and lang_id. * @return bool Whether the email notification was sent. */ - function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = array()) + function wpmu_welcome_notification( + $blog_id, + $user_id, + #[\SensitiveParameter] + $password, + $title, + $meta = array() + ) { } /** @@ -125546,7 +125633,12 @@ function wpmu_new_site_admin_notification($site_id, $user_id) * @param array $meta Optional. Signup meta data. Default empty array. * @return bool */ - function wpmu_welcome_user_notification($user_id, $password, $meta = array()) + function wpmu_welcome_user_notification( + $user_id, + #[\SensitiveParameter] + $password, + $meta = array() + ) { } /** @@ -125735,7 +125827,12 @@ function add_existing_user_to_blog($details = \false) * @param string $password User password. Ignored. * @param array $meta Signup meta data. */ - function add_new_user_to_blog($user_id, $password, $meta) + function add_new_user_to_blog( + $user_id, + #[\SensitiveParameter] + $password, + $meta + ) { } /** @@ -128228,7 +128325,15 @@ function get_user_by_email($email) * @param string $siteurl Optional. Will be used instead of SITECOOKIEPATH if set * @param bool $remember Optional. Remember that the user is logged in */ - function wp_setcookie($username, $password = '', $already_md5 = \false, $home = '', $siteurl = '', $remember = \false) + function wp_setcookie( + $username, + #[\SensitiveParameter] + $password = '', + $already_md5 = \false, + $home = '', + $siteurl = '', + $remember = \false + ) { } /** @@ -128276,7 +128381,12 @@ function wp_get_cookie_login() * @param string $deprecated Not used * @return bool True on successful check, false on login failure. */ - function wp_login($username, $password, $deprecated = '') + function wp_login( + $username, + #[\SensitiveParameter] + $password, + $deprecated = '' + ) { } /** @@ -128397,7 +128507,11 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array()) * @return WP_User|WP_Error WP_User object if the credentials are valid, * otherwise WP_Error. */ - function wp_authenticate($username, $password) + function wp_authenticate( + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -128861,7 +128975,10 @@ function wp_hash($data, $scheme = 'auth', $algo = 'md5') * @param string $password Plain text user password to hash. * @return string The hash string of the password. */ - function wp_hash_password($password) + function wp_hash_password( + #[\SensitiveParameter] + $password + ) { } /** @@ -128886,7 +129003,12 @@ function wp_hash_password($password) * @param string|int $user_id Optional. ID of a user associated with the password. * @return bool False, if the $password does not match the hashed password. */ - function wp_check_password($password, $hash, $user_id = '') + function wp_check_password( + #[\SensitiveParameter] + $password, + $hash, + $user_id = '' + ) { } /** @@ -128966,7 +129088,11 @@ function wp_rand($min = \null, $max = \null) * @param string $password The plaintext new user password. * @param int $user_id User ID. */ - function wp_set_password($password, $user_id) + function wp_set_password( + #[\SensitiveParameter] + $password, + $user_id + ) { } /** @@ -141884,7 +142010,12 @@ function wp_signon($credentials = array(), $secure_cookie = '') * @param string $password Password for authentication. * @return WP_User|WP_Error WP_User on success, WP_Error on failure. */ - function wp_authenticate_username_password($user, $username, $password) + function wp_authenticate_username_password( + $user, + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -141898,7 +142029,12 @@ function wp_authenticate_username_password($user, $username, $password) * @param string $password Password for authentication. * @return WP_User|WP_Error WP_User on success, WP_Error on failure. */ - function wp_authenticate_email_password($user, $email, $password) + function wp_authenticate_email_password( + $user, + $email, + #[\SensitiveParameter] + $password + ) { } /** @@ -141913,7 +142049,12 @@ function wp_authenticate_email_password($user, $email, $password) * @param string $password Password. If not empty, cancels the cookie authentication. * @return WP_User|WP_Error WP_User on success, WP_Error on failure. */ - function wp_authenticate_cookie($user, $username, $password) + function wp_authenticate_cookie( + $user, + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -141928,7 +142069,12 @@ function wp_authenticate_cookie($user, $username, $password) * @return WP_User|WP_Error|null WP_User on success, WP_Error on failure, null if * null is passed in and this isn't an API request. */ - function wp_authenticate_application_password($input_user, $username, $password) + function wp_authenticate_application_password( + $input_user, + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -142784,7 +142930,12 @@ function wp_update_user($userdata) * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not * be created. */ - function wp_create_user($username, $password, $email = '') + function wp_create_user( + $username, + #[\SensitiveParameter] + $password, + $email = '' + ) { } /** @@ -142864,7 +143015,11 @@ function get_password_reset_key($user) * @param string $login The user login. * @return WP_User|WP_Error WP_User object on success, WP_Error object for invalid or expired keys. */ - function check_password_reset_key($key, $login) + function check_password_reset_key( + #[\SensitiveParameter] + $key, + $login + ) { } /** @@ -142890,7 +143045,11 @@ function retrieve_password($user_login = '') * @param WP_User $user The user * @param string $new_pass New password for the user in plaintext */ - function reset_password($user, $new_pass) + function reset_password( + $user, + #[\SensitiveParameter] + $new_pass + ) { } /** @@ -143185,7 +143344,11 @@ function wp_generate_user_request_key($request_id) * @param string $key Provided key to validate. * @return true|WP_Error True on success, WP_Error on failure. */ - function wp_validate_user_request_key($request_id, $key) + function wp_validate_user_request_key( + $request_id, + #[\SensitiveParameter] + $key + ) { } /** From 08723447010c86c7d2fd7bdd0bd4668674b6cf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 2 Jun 2025 23:40:56 +0200 Subject: [PATCH 6/7] Impove generate.yml --- .github/workflows/generate.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 44ac9a98..296f6de3 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 - name: Install PHP @@ -26,12 +26,12 @@ jobs: - name: Generate stubs run: | - ./generate.sh # Generate stubs + ./generate.sh - name: Commit file run: | - git config --local user.name "GitHub Actions" - git config --local user.email "no-reply@github.com" - git add wordpress-stubs.php + git config --local user.name "${{ github.actor }}" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -- wordpress-stubs.php git commit -m "Update WordPress stubs" || exit 0 - git push origin ${{ github.ref_name }} + git push origin "${{ github.ref_name }}" From 9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Wed, 16 Jul 2025 08:41:00 +0200 Subject: [PATCH 7/7] Generate stubs for WordPress 6.8.2 (#292) --- source/composer.json | 2 +- wordpress-stubs.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/source/composer.json b/source/composer.json index ee83c736..5052df3b 100644 --- a/source/composer.json +++ b/source/composer.json @@ -7,7 +7,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "johnpbloch/wordpress": "6.8.1" + "johnpbloch/wordpress": "6.8.2" }, "minimum-stability": "stable", "config": { diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 59a54c13..1faea84f 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -91996,6 +91996,17 @@ function upgrade_650() function upgrade_670() { } + /** + * Executes changes made in WordPress 6.8.2. + * + * @ignore + * @since 6.8.2 + * + * @global int $wp_current_db_version The old (current) database version. + */ + function upgrade_682() + { + } /** * Executes network-level upgrade routines. * @@ -101980,6 +101991,7 @@ function wp_list_comments($args = array(), $comments = \null) * @since 4.6.0 Introduced the 'action' argument. * @since 4.9.6 Introduced the 'cookies' default comment field. * @since 5.5.0 Introduced the 'class_container' argument. + * @since 6.8.2 Introduced the 'novalidate' argument. * * @param array $args { * Optional. Default arguments and form fields to override. @@ -102001,6 +102013,7 @@ function wp_list_comments($args = array(), $comments = \null) * Default 'Your email address will not be published.'. * @type string $comment_notes_after HTML element for a message displayed after the textarea field. * @type string $action The comment form element action attribute. Default '/wp-comments-post.php'. + * @type bool $novalidate Whether the novalidate attribute is added to the comment form. Default false. * @type string $id_form The comment form element id attribute. Default 'commentform'. * @type string $id_submit The comment submit element id attribute. Default 'submit'. * @type string $class_container The comment form container class attribute. Default 'comment-respond'. @@ -102039,6 +102052,7 @@ function wp_list_comments($args = array(), $comments = \null) * comment_notes_before?: string, * comment_notes_after?: string, * action?: string, + * novalidate?: bool, * id_form?: string, * id_submit?: string, * class_container?: string,