From e490f4a415f68b156cad039164f35efbe17225c6 Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:36:02 +0100 Subject: [PATCH 1/3] Rebuild wordpress-stubs.php --- wordpress-stubs.php | 741 +++++++++++++++++++++++++++----------------- 1 file changed, 452 insertions(+), 289 deletions(-) diff --git a/wordpress-stubs.php b/wordpress-stubs.php index d3463ca..26f4c88 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -1363,7 +1363,7 @@ public function filter_upload_tabs($tabs) * @phpstan-param string|array{attachment_id: int<1, max>, url: string, width: int<0, max>, height: int<0, max>} $choice * @phpstan-return void */ - public final function set_header_image($choice) + final public function set_header_image($choice) { } /** @@ -1371,7 +1371,7 @@ public final function set_header_image($choice) * * @since 3.4.0 */ - public final function remove_header_image() + final public function remove_header_image() { } /** @@ -1382,7 +1382,7 @@ public final function remove_header_image() * @since 3.4.0 * @phpstan-return void */ - public final function reset_header_image() + final public function reset_header_image() { } /** @@ -1393,7 +1393,7 @@ public final function reset_header_image() * @param array $dimensions * @return array dst_height and dst_width of header image. */ - public final function get_header_dimensions($dimensions) + final public function get_header_dimensions($dimensions) { } /** @@ -1406,7 +1406,7 @@ public final function get_header_dimensions($dimensions) * @param int $parent_attachment_id Attachment ID of parent image. * @return array An array with attachment object data. */ - public final function create_attachment_object($cropped, $parent_attachment_id) + final public function create_attachment_object($cropped, $parent_attachment_id) { } /** @@ -1418,7 +1418,7 @@ public final function create_attachment_object($cropped, $parent_attachment_id) * @param string $cropped File path to cropped image. * @return int Attachment ID. */ - public final function insert_attachment($attachment, $cropped) + final public function insert_attachment($attachment, $cropped) { } /** @@ -7339,7 +7339,13 @@ public function cmpr_strlen($a, $b) * @param bool $head * @return array */ - public function get_page($url, $username = '', #[\SensitiveParameter] $password = '', $head = \false) + public function get_page( + $url, + $username = '', + #[\SensitiveParameter] + $password = '', + $head = \false + ) { } /** @@ -12990,7 +12996,7 @@ public function __construct(\getID3 $getid3, $call_module = \null) * * @return bool */ - public abstract function Analyze(); + abstract public function Analyze(); /** * Analyze from string instead. * @@ -13061,7 +13067,7 @@ protected function feof() * * @return bool */ - protected final function isDependencyFor($module) + final protected function isDependencyFor($module) { } /** @@ -17484,7 +17490,7 @@ class SMTP * * @var string[] */ - protected $smtp_transaction_id_patterns = ['exim' => '/[\\d]{3} OK id=(.*)/', 'sendmail' => '/[\\d]{3} 2\\.0\\.0 (.*) Message/', 'postfix' => '/[\\d]{3} 2\\.0\\.0 Ok: queued as (.*)/', 'Microsoft_ESMTP' => '/[0-9]{3} 2\\.[\\d]\\.0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\\d]{3} Ok (.*)/', 'SendGrid' => '/[\\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\\d]{3} 2\\.0\\.0 OK:([a-zA-Z\\d]{48})/', 'Haraka' => '/[\\d]{3} Message Queued \\((.*)\\)/', 'ZoneMTA' => '/[\\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\\d]{3} OK queued as (.*)/']; + protected $smtp_transaction_id_patterns = ['exim' => '/[\d]{3} OK id=(.*)/', 'sendmail' => '/[\d]{3} 2\.0\.0 (.*) Message/', 'postfix' => '/[\d]{3} 2\.0\.0 Ok: queued as (.*)/', 'Microsoft_ESMTP' => '/[0-9]{3} 2\.[\d]\.0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\d]{3} 2\.0\.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\d]{3} OK queued as (.*)/']; /** * Allowed SMTP XCLIENT attributes. * Must be allowed by the SMTP server. EHLO response is not checked. @@ -21385,11 +21391,11 @@ class SimplePie /** * PCRE for HTML attributes */ - public const PCRE_HTML_ATTRIBUTE = '((?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]+[^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3D\\x3E]*(?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*=[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x22\\x27\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x3E]*)?))?)*)[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*'; + public const PCRE_HTML_ATTRIBUTE = '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*'; /** * PCRE for XML attributes */ - public const PCRE_XML_ATTRIBUTE = '((?:\\s+(?:(?:[^\\s:]+:)?[^\\s:]+)\\s*=\\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\\s*'; + public const PCRE_XML_ATTRIBUTE = '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*'; /** * XML Namespace */ @@ -22150,7 +22156,7 @@ public function set_useragent($ua = null) * * @return void */ - public function set_cache_namefilter(\SimplePie\Cache\NameFilter $filter) : void + public function set_cache_namefilter(\SimplePie\Cache\NameFilter $filter): void { } /** @@ -22955,7 +22961,7 @@ class Cache * {@see register()} * @var array */ - protected static $handlers = ['mysql' => 'SimplePie\\Cache\\MySQL', 'memcache' => 'SimplePie\\Cache\\Memcache', 'memcached' => 'SimplePie\\Cache\\Memcached', 'redis' => 'SimplePie\\Cache\\Redis']; + protected static $handlers = ['mysql' => 'SimplePie\Cache\MySQL', 'memcache' => 'SimplePie\Cache\Memcache', 'memcached' => 'SimplePie\Cache\Memcached', 'redis' => 'SimplePie\Cache\Redis']; /** * Create a new SimplePie\Cache object * @@ -26899,10 +26905,10 @@ public function set_image_handler($page = false) public function set_registry(\SimplePie\Registry $registry) { } - public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\\Cache', ?\SimplePie\Cache\DataCache $cache = null) + public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\Cache', ?\SimplePie\Cache\DataCache $cache = null) { } - public function pass_file_data($file_class = 'SimplePie\\File', $timeout = 10, $useragent = '', $force_fsockopen = false) + public function pass_file_data($file_class = 'SimplePie\File', $timeout = 10, $useragent = '', $force_fsockopen = false) { } public function strip_htmltags($tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']) @@ -27426,7 +27432,7 @@ public function get_data(string $key, $default = null); * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set_data(string $key, array $value, ?int $ttl = null) : bool; + public function set_data(string $key, array $value, ?int $ttl = null): bool; /** * Delete an item from the cache by its unique key. * @@ -27442,7 +27448,7 @@ public function set_data(string $key, array $value, ?int $ttl = null) : bool; * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete_data(string $key) : bool; + public function delete_data(string $key): bool; } /** * Adapter for deprecated \SimplePie\Cache\Base implementations @@ -27494,7 +27500,7 @@ public function get_data(string $key, $default = null) * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set_data(string $key, array $value, ?int $ttl = null) : bool + public function set_data(string $key, array $value, ?int $ttl = null): bool { } /** @@ -27512,7 +27518,7 @@ public function set_data(string $key, array $value, ?int $ttl = null) : bool * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete_data(string $key) : bool + public function delete_data(string $key): bool { } } @@ -27545,7 +27551,7 @@ interface NameFilter * * @return string the new cache name */ - public function filter(string $name) : string; + public function filter(string $name): string; } /** * Creating a cache filename with callables @@ -27579,7 +27585,7 @@ public function __construct(callable $callable) * * @return string the new cache name */ - public function filter(string $name) : string + public function filter(string $name): string { } } @@ -27638,7 +27644,7 @@ public function get_data(string $key, $default = null) * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set_data(string $key, array $value, ?int $ttl = null) : bool + public function set_data(string $key, array $value, ?int $ttl = null): bool { } /** @@ -27656,7 +27662,7 @@ public function set_data(string $key, array $value, ?int $ttl = null) : bool * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete_data(string $key) : bool + public function delete_data(string $key): bool { } } @@ -29504,7 +29510,7 @@ public function add_node($args) * * @param array $args */ - protected final function _set_node($args) + final protected function _set_node($args) { } /** @@ -29515,7 +29521,7 @@ protected final function _set_node($args) * @param string $id * @return object|void Node. */ - public final function get_node($id) + final public function get_node($id) { } /** @@ -29524,7 +29530,7 @@ public final function get_node($id) * @param string $id * @return object|void */ - protected final function _get_node($id) + final protected function _get_node($id) { } /** @@ -29532,7 +29538,7 @@ protected final function _get_node($id) * * @return array|void */ - public final function get_nodes() + final public function get_nodes() { } /** @@ -29540,7 +29546,7 @@ public final function get_nodes() * * @return array|void */ - protected final function _get_nodes() + final protected function _get_nodes() { } /** @@ -29564,7 +29570,7 @@ protected final function _get_nodes() * meta?: array, * } $args */ - public final function add_group($args) + final public function add_group($args) { } /** @@ -29582,7 +29588,7 @@ public function remove_node($id) * * @param string $id */ - protected final function _unset_node($id) + final protected function _unset_node($id) { } /** @@ -29596,7 +29602,7 @@ public function render() * * @return object|void */ - protected final function _bind() + final protected function _bind() { } /** @@ -29604,7 +29610,7 @@ protected final function _bind() * * @param object $root */ - protected final function _render($root) + final protected function _render($root) { } /** @@ -29613,7 +29619,7 @@ protected final function _render($root) * @param object $node * @phpstan-return void */ - protected final function _render_container($node) + final protected function _render_container($node) { } /** @@ -29624,7 +29630,7 @@ protected final function _render_container($node) * @param string|bool $menu_title The accessible name of this ARIA menu or false if not provided. * @phpstan-return void */ - protected final function _render_group($node, $menu_title = \false) + final protected function _render_group($node, $menu_title = \false) { } /** @@ -29633,7 +29639,7 @@ protected final function _render_group($node, $menu_title = \false) * @param object $node * @phpstan-return void */ - protected final function _render_item($node) + final protected function _render_item($node) { } /** @@ -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(#[\SensitiveParameter] $raw_password) + public static function chunk_password( + #[\SensitiveParameter] + $raw_password + ) { } /** @@ -30035,7 +30044,10 @@ public static function chunk_password(#[\SensitiveParameter] $raw_password) * @param string $password Plaintext password. * @return string Hashed password. */ - public static function hash_password(#[\SensitiveParameter] string $password) : string + public static function hash_password( + #[\SensitiveParameter] + string $password + ): string { } /** @@ -30047,7 +30059,11 @@ public static function hash_password(#[\SensitiveParameter] string $password) : * @param string $hash Hash of the password to check against. * @return bool Whether the password matches the hashed password. */ - public static function check_password(#[\SensitiveParameter] string $password, string $hash) : bool + public static function check_password( + #[\SensitiveParameter] + string $password, + string $hash + ): bool { } } @@ -33190,7 +33206,7 @@ public function enqueue() * * @return bool Whether the control is active to the current preview. */ - public final function active() + final public function active() { } /** @@ -33215,7 +33231,7 @@ public function active_callback() * @param string $setting_key * @return mixed The requested setting's value, if the setting exists. */ - public final function value($setting_key = 'default') + final public function value($setting_key = 'default') { } /** @@ -33248,7 +33264,7 @@ public function json() * * @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true. */ - public final function check_capabilities() + final public function check_capabilities() { } /** @@ -33258,7 +33274,7 @@ public final function check_capabilities() * * @return string Contents of the control. */ - public final function get_content() + final public function get_content() { } /** @@ -33268,7 +33284,7 @@ public final function get_content() * @uses WP_Customize_Control::render() * @phpstan-return void */ - public final function maybe_render() + final public function maybe_render() { } /** @@ -33339,7 +33355,7 @@ protected function render_content() * * @since 4.1.0 */ - public final function print_template() + final public function print_template() { } /** @@ -35355,7 +35371,7 @@ public function __construct($manager, $id, $args = array()) * * @return bool Whether the panel is active to the current preview. */ - public final function active() + final public function active() { } /** @@ -35400,7 +35416,7 @@ public function check_capabilities() * * @return string Content for the panel. */ - public final function get_content() + final public function get_content() { } /** @@ -35409,7 +35425,7 @@ public final function get_content() * @since 4.0.0 * @phpstan-return void */ - public final function maybe_render() + final public function maybe_render() { } /** @@ -35642,7 +35658,7 @@ public function __construct($manager, $id, $args = array()) * * @return bool Whether the section is active to the current preview. */ - public final function active() + final public function active() { } /** @@ -35676,7 +35692,7 @@ public function json() * * @return bool False if theme doesn't support the section or user doesn't have the capability. */ - public final function check_capabilities() + final public function check_capabilities() { } /** @@ -35686,7 +35702,7 @@ public final function check_capabilities() * * @return string Contents of the section. */ - public final function get_content() + final public function get_content() { } /** @@ -35695,7 +35711,7 @@ public final function get_content() * @since 3.4.0 * @phpstan-return void */ - public final function maybe_render() + final public function maybe_render() { } /** @@ -35919,7 +35935,7 @@ public function __construct($manager, $id, $args = array()) * keys: array, * } */ - public final function id_data() + final public function id_data() { } /** @@ -35996,7 +36012,7 @@ public function preview() * @see WP_Customize_Manager::set_post_value() * @see WP_Customize_Setting::_multidimensional_preview_filter() */ - public final function _clear_aggregated_multidimensional_preview_applied_flag() + final public function _clear_aggregated_multidimensional_preview_applied_flag() { } /** @@ -36026,7 +36042,7 @@ public function _preview_filter($original) * @param mixed $original Original root value. * @return mixed New or old value. */ - public final function _multidimensional_preview_filter($original) + final public function _multidimensional_preview_filter($original) { } /** @@ -36038,7 +36054,7 @@ public final function _multidimensional_preview_filter($original) * @return void|false Void on success, false if cap check fails * or value isn't set or is invalid. */ - public final function save() + final public function save() { } /** @@ -36051,7 +36067,7 @@ public final function save() * @param mixed $default_value A default value which is used as a fallback. Default null. * @return mixed The default value on failure, otherwise the sanitized and validated value. */ - public final function post_value($default_value = \null) + final public function post_value($default_value = \null) { } /** @@ -36166,7 +36182,7 @@ public function json() * * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true. */ - public final function check_capabilities() + final public function check_capabilities() { } /** @@ -36179,7 +36195,7 @@ public final function check_capabilities() * @param bool $create Default false. * @return array|void Keys are 'root', 'node', and 'key'. */ - protected final function multidimensional(&$root, $keys, $create = \false) + final protected function multidimensional(&$root, $keys, $create = \false) { } /** @@ -36192,7 +36208,7 @@ protected final function multidimensional(&$root, $keys, $create = \false) * @param mixed $value The value to update. * @return mixed */ - protected final function multidimensional_replace($root, $keys, $value) + final protected function multidimensional_replace($root, $keys, $value) { } /** @@ -36205,7 +36221,7 @@ protected final function multidimensional_replace($root, $keys, $value) * @param mixed $default_value A default value which is used as a fallback. Default null. * @return mixed The requested value or the default value. */ - protected final function multidimensional_get($root, $keys, $default_value = \null) + final protected function multidimensional_get($root, $keys, $default_value = \null) { } /** @@ -36217,7 +36233,7 @@ protected final function multidimensional_get($root, $keys, $default_value = \nu * @param array $keys * @return bool True if value is set, false if not. */ - protected final function multidimensional_isset($root, $keys) + final protected function multidimensional_isset($root, $keys) { } } @@ -40426,7 +40442,7 @@ public static function supports_mime_type($mime_type) * * @return true|WP_Error True if loaded; WP_Error on failure. */ - public abstract function load(); + abstract public function load(); /** * Saves current image to file. * @@ -40455,7 +40471,7 @@ public abstract function load(); * filesize: int, * } */ - public abstract function save($destfilename = \null, $mime_type = \null); + abstract public function save($destfilename = \null, $mime_type = \null); /** * Resizes current image. * @@ -40482,7 +40498,7 @@ public abstract function save($destfilename = \null, $mime_type = \null); * 1: string, * } $crop */ - public abstract function resize($max_w, $max_h, $crop = \false); + abstract public function resize($max_w, $max_h, $crop = \false); /** * Resize multiple images from a single source. * @@ -40505,7 +40521,7 @@ public abstract function resize($max_w, $max_h, $crop = \false); * crop?: bool|array, * }> $sizes */ - public abstract function multi_resize($sizes); + abstract public function multi_resize($sizes); /** * Crops Image. * @@ -40521,7 +40537,7 @@ public abstract function multi_resize($sizes); * @param bool $src_abs Optional. If the source crop points are absolute. * @return true|WP_Error */ - public abstract function crop($src_x, $src_y, $src_w, $src_h, $dst_w = \null, $dst_h = \null, $src_abs = \false); + abstract public function crop($src_x, $src_y, $src_w, $src_h, $dst_w = \null, $dst_h = \null, $src_abs = \false); /** * Rotates current image counter-clockwise by $angle. * @@ -40531,7 +40547,7 @@ public abstract function crop($src_x, $src_y, $src_w, $src_h, $dst_w = \null, $d * @param float $angle * @return true|WP_Error */ - public abstract function rotate($angle); + abstract public function rotate($angle); /** * Flips current image. * @@ -40542,7 +40558,7 @@ public abstract function rotate($angle); * @param bool $vert Flip along Vertical Axis * @return true|WP_Error */ - public abstract function flip($horz, $vert); + abstract public function flip($horz, $vert); /** * Streams current image to browser. * @@ -40552,7 +40568,7 @@ public abstract function flip($horz, $vert); * @param string $mime_type The mime type of the image. * @return true|WP_Error True on success, WP_Error object on failure. */ - public abstract function stream($mime_type = \null); + abstract public function stream($mime_type = \null); /** * Gets dimensions of image. * @@ -41933,7 +41949,7 @@ class WP_MatchesMapRegex * * @var string */ - public $_pattern = '(\\$matches\\[[1-9]+[0-9]*\\])'; + public $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; /** * constructor * @@ -48068,7 +48084,7 @@ public function print_import_map() * The data for a Script Module will be serialized as JSON in a script tag with an ID of the * form `wp-script-module-data-{$module_id}`. */ - public function print_script_module_data() : void + public function print_script_module_data(): void { } /** @@ -48494,7 +48510,7 @@ protected function __construct($user_id) * @return WP_Session_Tokens The session object, which is by default an instance of * the `WP_User_Meta_Session_Tokens` class. */ - public static final function get_instance($user_id) + final public static function get_instance($user_id) { } /** @@ -48505,7 +48521,7 @@ public static final function get_instance($user_id) * @param string $token Session token. * @return array|null The session, or null if it does not exist. */ - public final function get($token) + final public function get($token) { } /** @@ -48518,7 +48534,7 @@ public final function get($token) * @param string $token Token to verify. * @return bool Whether the token is valid for the user. */ - public final function verify($token) + final public function verify($token) { } /** @@ -48537,7 +48553,7 @@ public final function verify($token) * @param int $expiration Session expiration timestamp. * @return string Session token. */ - public final function create($expiration) + final public function create($expiration) { } /** @@ -48548,7 +48564,7 @@ public final function create($expiration) * @param string $token Session token to update. * @param array $session Session information. */ - public final function update($token, $session) + final public function update($token, $session) { } /** @@ -48558,7 +48574,7 @@ public final function update($token, $session) * * @param string $token Session token to destroy. */ - public final function destroy($token) + final public function destroy($token) { } /** @@ -48568,7 +48584,7 @@ public final function destroy($token) * * @param string $token_to_keep Session token to keep. */ - public final function destroy_others($token_to_keep) + final public function destroy_others($token_to_keep) { } /** @@ -48579,7 +48595,7 @@ public final function destroy_others($token_to_keep) * @param array $session Session to check. * @return bool Whether session is valid. */ - protected final function is_still_valid($session) + final protected function is_still_valid($session) { } /** @@ -48587,7 +48603,7 @@ protected final function is_still_valid($session) * * @since 4.0.0 */ - public final function destroy_all() + final public function destroy_all() { } /** @@ -48595,7 +48611,7 @@ public final function destroy_all() * * @since 4.0.0 */ - public static final function destroy_all_for_all_users() + final public static function destroy_all_for_all_users() { } /** @@ -48605,7 +48621,7 @@ public static final function destroy_all_for_all_users() * * @return array Sessions for a user. */ - public final function get_all() + final public function get_all() { } /** @@ -48615,7 +48631,7 @@ public final function get_all() * * @return array Sessions of the user. */ - protected abstract function get_sessions(); + abstract protected function get_sessions(); /** * Retrieves a session based on its verifier (token hash). * @@ -48624,7 +48640,7 @@ protected abstract function get_sessions(); * @param string $verifier Verifier for the session to retrieve. * @return array|null The session, or null if it does not exist. */ - protected abstract function get_session($verifier); + abstract protected function get_session($verifier); /** * Updates a session based on its verifier (token hash). * @@ -48635,7 +48651,7 @@ protected abstract function get_session($verifier); * @param string $verifier Verifier for the session to update. * @param array $session Optional. Session. Omitting this argument destroys the session. */ - protected abstract function update_session($verifier, $session = \null); + abstract protected function update_session($verifier, $session = \null); /** * Destroys all sessions for this user, except the single session with the given verifier. * @@ -48643,13 +48659,13 @@ protected abstract function update_session($verifier, $session = \null); * * @param string $verifier Verifier of the session to keep. */ - protected abstract function destroy_other_sessions($verifier); + abstract protected function destroy_other_sessions($verifier); /** * Destroys all sessions for the user. * * @since 4.0.0 */ - protected abstract function destroy_all_sessions(); + abstract protected function destroy_all_sessions(); /** * Destroys all sessions for all users. * @@ -49283,7 +49299,7 @@ final class WP_Speculation_Rules implements \JsonSerializable * @return bool True on success, false if invalid parameters are provided. * @phpstan-param 'prefetch'|'prerender' $mode */ - public function add_rule(string $mode, string $id, array $rule) : bool + public function add_rule(string $mode, string $id, array $rule): bool { } /** @@ -49296,7 +49312,7 @@ public function add_rule(string $mode, string $id, array $rule) : bool * @return bool True if the rule already exists, false otherwise. * @phpstan-param 'prefetch'|'prerender' $mode */ - public function has_rule(string $mode, string $id) : bool + public function has_rule(string $mode, string $id): bool { } /** @@ -49318,7 +49334,7 @@ public function jsonSerialize() * @param string $mode Speculation rules mode. * @return bool True if valid, false otherwise. */ - public static function is_valid_mode(string $mode) : bool + public static function is_valid_mode(string $mode): bool { } /** @@ -49329,7 +49345,7 @@ public static function is_valid_mode(string $mode) : bool * @param string $eagerness Speculation rules eagerness. * @return bool True if valid, false otherwise. */ - public static function is_valid_eagerness(string $eagerness) : bool + public static function is_valid_eagerness(string $eagerness): bool { } /** @@ -49340,7 +49356,7 @@ public static function is_valid_eagerness(string $eagerness) : bool * @param string $source Speculation rules source. * @return bool True if valid, false otherwise. */ - public static function is_valid_source(string $source) : bool + public static function is_valid_source(string $source): bool { } } @@ -53735,7 +53751,7 @@ class WP_Token_Map * * @return WP_Token_Map|null Token map, unless unable to create it. */ - public static function from_array(array $mappings, int $key_length = 2) : ?\WP_Token_Map + public static function from_array(array $mappings, int $key_length = 2): ?\WP_Token_Map { } /** @@ -53768,7 +53784,7 @@ public static function from_array(array $mappings, int $key_length = 2) : ?\WP_T * small_mappings?: array, * } $state */ - public static function from_precomputed_table($state) : ?\WP_Token_Map + public static function from_precomputed_table($state): ?\WP_Token_Map { } /** @@ -53785,7 +53801,7 @@ public static function from_precomputed_table($state) : ?\WP_Token_Map * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. * @return bool Whether there's an entry for the given word in the map. */ - public function contains(string $word, string $case_sensitivity = 'case-sensitive') : bool + public function contains(string $word, string $case_sensitivity = 'case-sensitive'): bool { } /** @@ -53831,7 +53847,7 @@ public function contains(string $word, string $case_sensitivity = 'case-sensitiv * * @return string|null Mapped value of lookup key if found, otherwise `null`. */ - public function read_token(string $text, int $offset = 0, &$matched_token_byte_length = \null, $case_sensitivity = 'case-sensitive') : ?string + public function read_token(string $text, int $offset = 0, &$matched_token_byte_length = \null, $case_sensitivity = 'case-sensitive'): ?string { } /** @@ -53848,7 +53864,7 @@ public function read_token(string $text, int $offset = 0, &$matched_token_byte_l * * @return array The lookup key/substitution values as an associate array. */ - public function to_array() : array + public function to_array(): array { } /** @@ -53879,7 +53895,7 @@ public function to_array() : array * @param string $indent Optional. Use this string for indentation, or rely on the default horizontal tab character. Default "\t". * @return string Value which can be pasted into a PHP source file for quick loading of table. */ - public function precomputed_php_source_table(string $indent = "\t") : string + public function precomputed_php_source_table(string $indent = "\t"): string { } } @@ -53919,7 +53935,7 @@ public function __construct(array $contexts = array()) * @param string $context Optional. Context to use for prefixing the path pattern. Default 'home'. * @return string URL pattern, prefixed as necessary. */ - public function prefix_path_pattern(string $path_pattern, string $context = 'home') : string + public function prefix_path_pattern(string $path_pattern, string $context = 'home'): string { } /** @@ -53929,7 +53945,7 @@ public function prefix_path_pattern(string $path_pattern, string $context = 'hom * * @return array Map of `$context_string => $base_path` pairs. */ - public static function get_default_contexts() : array + public static function get_default_contexts(): array { } } @@ -55581,7 +55597,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, #[\SensitiveParameter] $password) + public function login( + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -55595,7 +55615,11 @@ public function login($username, #[\SensitiveParameter] $password) * @param string $password User's password. * @return bool Whether authentication passed. */ - public function login_pass_ok($username, #[\SensitiveParameter] $password) + public function login_pass_ok( + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -58607,7 +58631,13 @@ class wpdb * @param string $dbhost Database host. * @phpstan-return void */ - public function __construct($dbuser, #[\SensitiveParameter] $dbpassword, $dbname, $dbhost) + public function __construct( + $dbuser, + #[\SensitiveParameter] + $dbpassword, + $dbname, + $dbhost + ) { } /** @@ -60970,7 +61000,7 @@ public function json() */ class WP_Customize_Nav_Menu_Item_Setting extends \WP_Customize_Setting { - const ID_PATTERN = '/^nav_menu_item\\[(?P-?\\d+)\\]$/'; + const ID_PATTERN = '/^nav_menu_item\[(?P-?\d+)\]$/'; const POST_TYPE = 'nav_menu_item'; const TYPE = 'nav_menu_item'; /** @@ -61433,7 +61463,7 @@ public function json() */ class WP_Customize_Nav_Menu_Setting extends \WP_Customize_Setting { - const ID_PATTERN = '/^nav_menu\\[(?P-?\\d+)\\]$/'; + const ID_PATTERN = '/^nav_menu\[(?P-?\d+)\]$/'; const TAXONOMY = 'nav_menu'; const TYPE = 'nav_menu'; /** @@ -62043,7 +62073,7 @@ public function __construct(\WP_Customize_Selective_Refresh $component, $id, $ar * keys: array, * } */ - public final function id_data() + final public function id_data() { } /** @@ -62056,7 +62086,7 @@ public final function id_data() * @return string|array|false The rendered partial as a string, raw data array (for client-side JS template), * or false if no render applied. */ - public final function render($container_context = array()) + final public function render($container_context = array()) { } /** @@ -62101,7 +62131,7 @@ public function json() * @return bool False if user can't edit one of the related settings, * or if one of the associated settings does not exist. */ - public final function check_capabilities() + final public function check_capabilities() { } } @@ -63073,7 +63103,7 @@ public function current_node() * * @since 6.7.0 */ - public function insert_marker() : void + public function insert_marker(): void { } /** @@ -63160,7 +63190,7 @@ public function walk_up() * * @since 6.7.0 */ - public function clear_up_to_last_marker() : void + public function clear_up_to_last_marker(): void { } } @@ -63293,7 +63323,7 @@ class WP_HTML_Decoder * Default 'case-sensitive'. * @return bool Whether the attribute value starts with the given string. */ - public static function attribute_starts_with($haystack, $search_text, $case_sensitivity = 'case-sensitive') : bool + public static function attribute_starts_with($haystack, $search_text, $case_sensitivity = 'case-sensitive'): bool { } /** @@ -63313,7 +63343,7 @@ public static function attribute_starts_with($haystack, $search_text, $case_sens * @param string $text Text containing raw and non-decoded text node to decode. * @return string Decoded UTF-8 value of given text node. */ - public static function decode_text_node($text) : string + public static function decode_text_node($text): string { } /** @@ -63332,7 +63362,7 @@ public static function decode_text_node($text) : string * @param string $text Text containing raw and non-decoded attribute value to decode. * @return string Decoded UTF-8 value of given attribute value. */ - public static function decode_attribute($text) : string + public static function decode_attribute($text): string { } /** @@ -63354,7 +63384,7 @@ public static function decode_attribute($text) : string * @param string $text Text document containing span of text to decode. * @return string Decoded UTF-8 string. */ - public static function decode($context, $text) : string + public static function decode($context, $text): string { } /** @@ -63417,7 +63447,7 @@ public static function read_character_reference($context, $text, $at = 0, &$matc * @param int $code_point Which code point to convert. * @return string Converted code point, or `�` if invalid. */ - public static function code_point_to_utf8_bytes($code_point) : string + public static function code_point_to_utf8_bytes($code_point): string { } } @@ -63596,7 +63626,7 @@ class WP_HTML_Doctype_Info * @return WP_HTML_Doctype_Info|null A WP_HTML_Doctype_Info instance will be returned if the * provided DOCTYPE HTML is a valid DOCTYPE. Otherwise, null. */ - public static function from_doctype_token(string $doctype_html) : ?self + public static function from_doctype_token(string $doctype_html): ?self { } } @@ -63640,7 +63670,7 @@ class WP_HTML_Open_Elements * * @param Closure $handler The handler function. */ - public function set_pop_handler(\Closure $handler) : void + public function set_pop_handler(\Closure $handler): void { } /** @@ -63653,7 +63683,7 @@ public function set_pop_handler(\Closure $handler) : void * * @param Closure $handler The handler function. */ - public function set_push_handler(\Closure $handler) : void + public function set_push_handler(\Closure $handler): void { } /** @@ -63671,7 +63701,7 @@ public function set_push_handler(\Closure $handler) : void * @return WP_HTML_Token|null Name of the node on the stack at the given location, * or `null` if the location isn't on the stack. */ - public function at(int $nth) : ?\WP_HTML_Token + public function at(int $nth): ?\WP_HTML_Token { } /** @@ -63682,7 +63712,7 @@ public function at(int $nth) : ?\WP_HTML_Token * @param string $node_name Name of node for which to check. * @return bool Whether a node of the given name is in the stack of open elements. */ - public function contains(string $node_name) : bool + public function contains(string $node_name): bool { } /** @@ -63693,7 +63723,7 @@ public function contains(string $node_name) : bool * @param WP_HTML_Token $token Look for this node in the stack. * @return bool Whether the referenced node is in the stack of open elements. */ - public function contains_node(\WP_HTML_Token $token) : bool + public function contains_node(\WP_HTML_Token $token): bool { } /** @@ -63703,7 +63733,7 @@ public function contains_node(\WP_HTML_Token $token) : bool * * @return int How many node are in the stack of open elements. */ - public function count() : int + public function count(): int { } /** @@ -63714,7 +63744,7 @@ public function count() : int * * @return WP_HTML_Token|null Last node in the stack of open elements, if one exists, otherwise null. */ - public function current_node() : ?\WP_HTML_Token + public function current_node(): ?\WP_HTML_Token { } /** @@ -63744,7 +63774,7 @@ public function current_node() : ?\WP_HTML_Token * @param string $identity Check if the current node has this name or type (depending on what is provided). * @return bool Whether there is a current element that matches the given identity, whether a token name or type. */ - public function current_node_is(string $identity) : bool + public function current_node_is(string $identity): bool { } /** @@ -63758,7 +63788,7 @@ public function current_node_is(string $identity) : bool * @param string[] $termination_list List of elements that terminate the search. * @return bool Whether the element was found in a specific scope. */ - public function has_element_in_specific_scope(string $tag_name, $termination_list) : bool + public function has_element_in_specific_scope(string $tag_name, $termination_list): bool { } /** @@ -63795,7 +63825,7 @@ public function has_element_in_specific_scope(string $tag_name, $termination_lis * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_scope(string $tag_name) : bool + public function has_element_in_scope(string $tag_name): bool { } /** @@ -63818,7 +63848,7 @@ public function has_element_in_scope(string $tag_name) : bool * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_list_item_scope(string $tag_name) : bool + public function has_element_in_list_item_scope(string $tag_name): bool { } /** @@ -63839,7 +63869,7 @@ public function has_element_in_list_item_scope(string $tag_name) : bool * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_button_scope(string $tag_name) : bool + public function has_element_in_button_scope(string $tag_name): bool { } /** @@ -63861,7 +63891,7 @@ public function has_element_in_button_scope(string $tag_name) : bool * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_table_scope(string $tag_name) : bool + public function has_element_in_table_scope(string $tag_name): bool { } /** @@ -63884,7 +63914,7 @@ public function has_element_in_table_scope(string $tag_name) : bool * @param string $tag_name Name of tag to check. * @return bool Whether the given element is in SELECT scope. */ - public function has_element_in_select_scope(string $tag_name) : bool + public function has_element_in_select_scope(string $tag_name): bool { } /** @@ -63896,7 +63926,7 @@ public function has_element_in_select_scope(string $tag_name) : bool * * @return bool Whether a P is in BUTTON scope. */ - public function has_p_in_button_scope() : bool + public function has_p_in_button_scope(): bool { } /** @@ -63908,7 +63938,7 @@ public function has_p_in_button_scope() : bool * * @return bool Whether a node was popped off of the stack. */ - public function pop() : bool + public function pop(): bool { } /** @@ -63921,7 +63951,7 @@ public function pop() : bool * @param string $html_tag_name Name of tag that needs to be popped off of the stack of open elements. * @return bool Whether a tag of the given name was found and popped off of the stack of open elements. */ - public function pop_until(string $html_tag_name) : bool + public function pop_until(string $html_tag_name): bool { } /** @@ -63933,7 +63963,7 @@ public function pop_until(string $html_tag_name) : bool * * @param WP_HTML_Token $stack_item Item to add onto stack. */ - public function push(\WP_HTML_Token $stack_item) : void + public function push(\WP_HTML_Token $stack_item): void { } /** @@ -63944,7 +63974,7 @@ public function push(\WP_HTML_Token $stack_item) : void * @param WP_HTML_Token $token The node to remove from the stack of open elements. * @return bool Whether the node was found and removed from the stack of open elements. */ - public function remove_node(\WP_HTML_Token $token) : bool + public function remove_node(\WP_HTML_Token $token): bool { } /** @@ -64008,7 +64038,7 @@ public function walk_up(?\WP_HTML_Token $above_this_node = \null) * * @param WP_HTML_Token $item Element that was added to the stack of open elements. */ - public function after_element_push(\WP_HTML_Token $item) : void + public function after_element_push(\WP_HTML_Token $item): void { } /** @@ -64024,7 +64054,7 @@ public function after_element_push(\WP_HTML_Token $item) : void * * @param WP_HTML_Token $item Element that was removed from the stack of open elements. */ - public function after_element_pop(\WP_HTML_Token $item) : void + public function after_element_pop(\WP_HTML_Token $item): void { } /** @@ -64038,7 +64068,7 @@ public function after_element_pop(\WP_HTML_Token $item) : void * * @since 6.7.0 */ - public function clear_to_table_context() : void + public function clear_to_table_context(): void { } /** @@ -64052,7 +64082,7 @@ public function clear_to_table_context() : void * * @since 6.7.0 */ - public function clear_to_table_body_context() : void + public function clear_to_table_body_context(): void { } /** @@ -64066,7 +64096,7 @@ public function clear_to_table_body_context() : void * * @since 6.7.0 */ - public function clear_to_table_row_context() : void + public function clear_to_table_row_context(): void { } /** @@ -65070,7 +65100,7 @@ public function __construct($html) * @return bool Whether the namespace was valid and changed. * @phpstan-param 'html'|'svg'|'math' $new_namespace */ - public function change_parsing_namespace(string $new_namespace) : bool + public function change_parsing_namespace(string $new_namespace): bool { } /** @@ -65097,7 +65127,7 @@ public function change_parsing_namespace(string $new_namespace) : bool * tag_closers?: string|null, * } $query */ - public function next_tag($query = \null) : bool + public function next_tag($query = \null): bool { } /** @@ -65128,7 +65158,7 @@ public function next_tag($query = \null) : bool * * @return bool Whether a token was parsed. */ - public function next_token() : bool + public function next_token(): bool { } /** @@ -65145,7 +65175,7 @@ public function next_token() : bool * * @return bool Whether the parse paused at the start of an incomplete token. */ - public function paused_at_incomplete_token() : bool + public function paused_at_incomplete_token(): bool { } /** @@ -65176,7 +65206,7 @@ public function class_list() * @param string $wanted_class Look for this CSS class name, ASCII case-insensitive. * @return bool|null Whether the matched tag contains the given class name, or null if not matched. */ - public function has_class($wanted_class) : ?bool + public function has_class($wanted_class): ?bool { } /** @@ -65259,7 +65289,7 @@ public function has_class($wanted_class) : ?bool * @param string $name Identifies this particular bookmark. * @return bool Whether the bookmark was successfully created. */ - public function set_bookmark($name) : bool + public function set_bookmark($name): bool { } /** @@ -65271,7 +65301,7 @@ public function set_bookmark($name) : bool * @param string $name Name of the bookmark to remove. * @return bool Whether the bookmark already existed before removal. */ - public function release_bookmark($name) : bool + public function release_bookmark($name): bool { } /** @@ -65282,7 +65312,7 @@ public function release_bookmark($name) : bool * @param string $bookmark_name Name to identify a bookmark that potentially exists. * @return bool Whether that bookmark exists. */ - public function has_bookmark($bookmark_name) : bool + public function has_bookmark($bookmark_name): bool { } /** @@ -65296,7 +65326,7 @@ public function has_bookmark($bookmark_name) : bool * @param string $bookmark_name Jump to the place in the document identified by this bookmark name. * @return bool Whether the internal cursor was successfully moved to the bookmark's location. */ - public function seek($bookmark_name) : bool + public function seek($bookmark_name): bool { } /** @@ -65347,7 +65377,7 @@ public function get_attribute($name) * @param string $prefix Prefix of requested attribute names. * @return array|null List of attribute names, or `null` when no tag opener is matched. */ - public function get_attribute_names_with_prefix($prefix) : ?array + public function get_attribute_names_with_prefix($prefix): ?array { } /** @@ -65358,7 +65388,7 @@ public function get_attribute_names_with_prefix($prefix) : ?array * @return string One of 'html', 'math', or 'svg'. * @phpstan-return 'html'|'math'|'svg' */ - public function get_namespace() : string + public function get_namespace(): string { } /** @@ -65377,7 +65407,7 @@ public function get_namespace() : string * * @return string|null Name of currently matched tag in input HTML, or `null` if none found. */ - public function get_tag() : ?string + public function get_tag(): ?string { } /** @@ -65388,7 +65418,7 @@ public function get_tag() : ?string * * @return string|null Name of current tag name. */ - public function get_qualified_tag_name() : ?string + public function get_qualified_tag_name(): ?string { } /** @@ -65401,7 +65431,7 @@ public function get_qualified_tag_name() : ?string * * @return string|null */ - public function get_qualified_attribute_name($attribute_name) : ?string + public function get_qualified_attribute_name($attribute_name): ?string { } /** @@ -65421,7 +65451,7 @@ public function get_qualified_attribute_name($attribute_name) : ?string * * @return bool Whether the currently matched tag contains the self-closing flag. */ - public function has_self_closing_flag() : bool + public function has_self_closing_flag(): bool { } /** @@ -65441,7 +65471,7 @@ public function has_self_closing_flag() : bool * * @return bool Whether the current tag is a tag closer. */ - public function is_tag_closer() : bool + public function is_tag_closer(): bool { } /** @@ -65466,7 +65496,7 @@ public function is_tag_closer() : bool * * @return string|null What kind of token is matched, or null. */ - public function get_token_type() : ?string + public function get_token_type(): ?string { } /** @@ -65489,7 +65519,7 @@ public function get_token_type() : ?string * * @return string|null Name of the matched token. */ - public function get_token_name() : ?string + public function get_token_name(): ?string { } /** @@ -65511,7 +65541,7 @@ public function get_token_name() : ?string * * @return string|null */ - public function get_comment_type() : ?string + public function get_comment_type(): ?string { } /** @@ -65532,7 +65562,7 @@ public function get_comment_type() : ?string * @return string|null The comment text as it would appear in the browser or null * if not on a comment type node. */ - public function get_full_comment_text() : ?string + public function get_full_comment_text(): ?string { } /** @@ -65566,7 +65596,7 @@ public function get_full_comment_text() : ?string * * @return bool Whether the text node was subdivided. */ - public function subdivide_text_appropriately() : bool + public function subdivide_text_appropriately(): bool { } /** @@ -65597,7 +65627,7 @@ public function subdivide_text_appropriately() : bool * * @return string */ - public function get_modifiable_text() : string + public function get_modifiable_text(): string { } /** @@ -65646,7 +65676,7 @@ public function get_modifiable_text() : string * * @return bool Whether the text was able to update. */ - public function set_modifiable_text(string $plaintext_content) : bool + public function set_modifiable_text(string $plaintext_content): bool { } /** @@ -65665,7 +65695,7 @@ public function set_modifiable_text(string $plaintext_content) : bool * @param string|bool $value The new attribute value. * @return bool Whether an attribute value was set. */ - public function set_attribute($name, $value) : bool + public function set_attribute($name, $value): bool { } /** @@ -65676,7 +65706,7 @@ public function set_attribute($name, $value) : bool * @param string $name The attribute name to remove. * @return bool Whether an attribute was removed. */ - public function remove_attribute($name) : bool + public function remove_attribute($name): bool { } /** @@ -65687,7 +65717,7 @@ public function remove_attribute($name) : bool * @param string $class_name The class name to add. * @return bool Whether the class was set to be added. */ - public function add_class($class_name) : bool + public function add_class($class_name): bool { } /** @@ -65698,7 +65728,7 @@ public function add_class($class_name) : bool * @param string $class_name The class name to remove. * @return bool Whether the class was set to be removed. */ - public function remove_class($class_name) : bool + public function remove_class($class_name): bool { } /** @@ -65710,7 +65740,7 @@ public function remove_class($class_name) : bool * * @return string The processed HTML. */ - public function __toString() : string + public function __toString(): string { } /** @@ -65722,7 +65752,7 @@ public function __toString() : string * * @return string The processed HTML. */ - public function get_updated_html() : string + public function get_updated_html(): string { } /** @@ -65738,7 +65768,7 @@ public function get_updated_html() : string * @return WP_HTML_Doctype_Info|null The DOCTYPE declaration information or `null` if not * currently at a DOCTYPE node. */ - public function get_doctype_info() : ?\WP_HTML_Doctype_Info + public function get_doctype_info(): ?\WP_HTML_Doctype_Info { } /** @@ -66226,7 +66256,7 @@ public function __construct($html, $use_the_static_create_methods_instead = \nul * * @return string|null The last error, if one exists, otherwise null. */ - public function get_last_error() : ?string + public function get_last_error(): ?string { } /** @@ -66274,7 +66304,7 @@ public function get_unsupported_exception() * breadcrumbs?: string[], * } $query */ - public function next_tag($query = \null) : bool + public function next_tag($query = \null): bool { } /** @@ -66289,7 +66319,7 @@ public function next_tag($query = \null) : bool * * @return bool Whether a token was parsed. */ - public function next_token() : bool + public function next_token(): bool { } /** @@ -66308,7 +66338,7 @@ public function next_token() : bool * * @return bool Whether the current tag is a tag closer. */ - public function is_tag_closer() : bool + public function is_tag_closer(): bool { } /** @@ -66336,7 +66366,7 @@ public function is_tag_closer() : bool * May also contain the wildcard `*` which matches a single element, e.g. `array( 'SECTION', '*' )`. * @return bool Whether the currently-matched tag is found at the given nested structure. */ - public function matches_breadcrumbs($breadcrumbs) : bool + public function matches_breadcrumbs($breadcrumbs): bool { } /** @@ -66357,7 +66387,7 @@ public function matches_breadcrumbs($breadcrumbs) : bool * @return bool|null Whether to expect a closer for the currently-matched node, * or `null` if not matched on any token. */ - public function expects_closer(?\WP_HTML_Token $node = \null) : ?bool + public function expects_closer(?\WP_HTML_Token $node = \null): ?bool { } /** @@ -66373,7 +66403,7 @@ public function expects_closer(?\WP_HTML_Token $node = \null) : ?bool * @param string $node_to_process Whether to parse the next node or reprocess the current node. * @return bool Whether a tag was matched. */ - public function step($node_to_process = self::PROCESS_NEXT_NODE) : bool + public function step($node_to_process = self::PROCESS_NEXT_NODE): bool { } /** @@ -66392,7 +66422,7 @@ public function step($node_to_process = self::PROCESS_NEXT_NODE) : bool * * @return string[] Array of tag names representing path to matched node. */ - public function get_breadcrumbs() : array + public function get_breadcrumbs(): array { } /** @@ -66420,7 +66450,7 @@ public function get_breadcrumbs() : array * * @return int Nesting-depth of current location in the document. */ - public function get_current_depth() : int + public function get_current_depth(): int { } /** @@ -66461,7 +66491,7 @@ public function get_current_depth() : int * * @return string|null Normalized output, or `null` if unable to normalize. */ - public static function normalize(string $html) : ?string + public static function normalize(string $html): ?string { } /** @@ -66503,7 +66533,7 @@ public static function normalize(string $html) : ?string * @return string|null Normalized HTML markup represented by processor, * or `null` if unable to generate serialization. */ - public function serialize() : ?string + public function serialize(): ?string { } /** @@ -66519,7 +66549,7 @@ public function serialize() : ?string * * @return string Serialization of token, or empty string if no serialization exists. */ - protected function serialize_token() : string + protected function serialize_token(): string { } /** @@ -66527,7 +66557,7 @@ protected function serialize_token() : string * * @return string One of "html", "math", or "svg". */ - public function get_namespace() : string + public function get_namespace(): string { } /** @@ -66551,7 +66581,7 @@ public function get_namespace() : string * * @return string|null Name of currently matched tag in input HTML, or `null` if none found. */ - public function get_tag() : ?string + public function get_tag(): ?string { } /** @@ -66571,7 +66601,7 @@ public function get_tag() : ?string * * @return bool Whether the currently matched tag contains the self-closing flag. */ - public function has_self_closing_flag() : bool + public function has_self_closing_flag(): bool { } /** @@ -66594,7 +66624,7 @@ public function has_self_closing_flag() : bool * * @return string|null Name of the matched token. */ - public function get_token_name() : ?string + public function get_token_name(): ?string { } /** @@ -66619,7 +66649,7 @@ public function get_token_name() : ?string * * @return string|null What kind of token is matched, or null. */ - public function get_token_type() : ?string + public function get_token_type(): ?string { } /** @@ -66659,7 +66689,7 @@ public function get_attribute($name) * @param string|bool $value The new attribute value. * @return bool Whether an attribute value was set. */ - public function set_attribute($name, $value) : bool + public function set_attribute($name, $value): bool { } /** @@ -66670,7 +66700,7 @@ public function set_attribute($name, $value) : bool * @param string $name The attribute name to remove. * @return bool Whether an attribute was removed. */ - public function remove_attribute($name) : bool + public function remove_attribute($name): bool { } /** @@ -66699,7 +66729,7 @@ public function remove_attribute($name) : bool * @param string $prefix Prefix of requested attribute names. * @return array|null List of attribute names, or `null` when no tag opener is matched. */ - public function get_attribute_names_with_prefix($prefix) : ?array + public function get_attribute_names_with_prefix($prefix): ?array { } /** @@ -66710,7 +66740,7 @@ public function get_attribute_names_with_prefix($prefix) : ?array * @param string $class_name The class name to add. * @return bool Whether the class was set to be added. */ - public function add_class($class_name) : bool + public function add_class($class_name): bool { } /** @@ -66721,7 +66751,7 @@ public function add_class($class_name) : bool * @param string $class_name The class name to remove. * @return bool Whether the class was set to be removed. */ - public function remove_class($class_name) : bool + public function remove_class($class_name): bool { } /** @@ -66736,7 +66766,7 @@ public function remove_class($class_name) : bool * @param string $wanted_class Look for this CSS class name, ASCII case-insensitive. * @return bool|null Whether the matched tag contains the given class name, or null if not matched. */ - public function has_class($wanted_class) : ?bool + public function has_class($wanted_class): ?bool { } /** @@ -66778,7 +66808,7 @@ public function class_list() * * @return string */ - public function get_modifiable_text() : string + public function get_modifiable_text(): string { } /** @@ -66800,7 +66830,7 @@ public function get_modifiable_text() : string * * @return string|null */ - public function get_comment_type() : ?string + public function get_comment_type(): ?string { } /** @@ -66814,7 +66844,7 @@ public function get_comment_type() : ?string * @param string $bookmark_name Name of the bookmark to remove. * @return bool Whether the bookmark already existed before removal. */ - public function release_bookmark($bookmark_name) : bool + public function release_bookmark($bookmark_name): bool { } /** @@ -66834,7 +66864,7 @@ public function release_bookmark($bookmark_name) : bool * @param string $bookmark_name Jump to the place in the document identified by this bookmark name. * @return bool Whether the internal cursor was successfully moved to the bookmark's location. */ - public function seek($bookmark_name) : bool + public function seek($bookmark_name): bool { } /** @@ -66922,7 +66952,7 @@ public function seek($bookmark_name) : bool * @param string $bookmark_name Identifies this particular bookmark. * @return bool Whether the bookmark was successfully created. */ - public function set_bookmark($bookmark_name) : bool + public function set_bookmark($bookmark_name): bool { } /** @@ -66933,7 +66963,7 @@ public function set_bookmark($bookmark_name) : bool * @param string $bookmark_name Name to identify a bookmark that potentially exists. * @return bool Whether that bookmark exists. */ - public function has_bookmark($bookmark_name) : bool + public function has_bookmark($bookmark_name): bool { } /** @@ -66946,7 +66976,7 @@ public function has_bookmark($bookmark_name) : bool * @param WP_HTML_Token|string $tag_name Node to check, or only its name if in the HTML namespace. * @return bool Whether the element of the given name is in the special category. */ - public static function is_special($tag_name) : bool + public static function is_special($tag_name): bool { } /** @@ -66961,7 +66991,7 @@ public static function is_special($tag_name) : bool * @param string $tag_name Name of HTML tag to check. * @return bool Whether the given tag is an HTML Void Element. */ - public static function is_void($tag_name) : bool + public static function is_void($tag_name): bool { } /** @@ -66987,7 +67017,7 @@ public static function is_void($tag_name) : bool * @param string $label A string which may specify a known encoding. * @return string|null Known encoding if matched, otherwise null. */ - protected static function get_encoding(string $label) : ?string + protected static function get_encoding(string $label): ?string { } /* @@ -67452,7 +67482,7 @@ public function get_content_between_balanced_template_tags() * @param string $new_content The string to replace the content between the matching tags. * @return bool Whether the content was successfully replaced. */ - public function set_content_between_balanced_tags(string $new_content) : bool + public function set_content_between_balanced_tags(string $new_content): bool { } /** @@ -67466,7 +67496,7 @@ public function set_content_between_balanced_tags(string $new_content) : bool * @param string $new_content The string to append after the closing template tag. * @return bool Whether the content was successfully appended. */ - public function append_content_after_template_tag_closer(string $new_content) : bool + public function append_content_after_template_tag_closer(string $new_content): bool { } /** @@ -67484,7 +67514,7 @@ public function append_content_after_template_tag_closer(string $new_content) : * * @return bool Whether the foreign content was successfully skipped. */ - public function skip_to_tag_closer() : bool + public function skip_to_tag_closer(): bool { } /** @@ -67502,7 +67532,7 @@ public function skip_to_tag_closer() : bool * * @return bool Whether a matching closing tag was found. */ - public function next_balanced_tag_closer_tag() : bool + public function next_balanced_tag_closer_tag(): bool { } /** @@ -67514,7 +67544,7 @@ public function next_balanced_tag_closer_tag() : bool * * @return bool Whether the current tag has a closer tag. */ - public function has_and_visits_its_closer_tag() : bool + public function has_and_visits_its_closer_tag(): bool { } } @@ -67544,7 +67574,7 @@ final class WP_Interactivity_API * @return array The current state for the specified store namespace. This will be the updated state if a $state * argument was provided. */ - public function state(?string $store_namespace = \null, ?array $state = \null) : array + public function state(?string $store_namespace = \null, ?array $state = \null): array { } /** @@ -67562,7 +67592,7 @@ public function state(?string $store_namespace = \null, ?array $state = \null) : * @return array The configuration for the specified store namespace. This will be the updated configuration if a * $config argument was provided. */ - public function config(string $store_namespace, array $config = array()) : array + public function config(string $store_namespace, array $config = array()): array { } /** @@ -67591,7 +67621,7 @@ public function print_client_interactivity_data() * @param array $data Data to filter. * @return array Data for the Interactivity Router script module. */ - public function filter_script_module_interactivity_router_data(array $data) : array + public function filter_script_module_interactivity_router_data(array $data): array { } /** @@ -67605,7 +67635,7 @@ public function filter_script_module_interactivity_router_data(array $data) : ar * @param array $data Data to filter. * @return array Data for the Interactivity API script module. */ - public function filter_script_module_interactivity_data(array $data) : array + public function filter_script_module_interactivity_data(array $data): array { } /** @@ -67618,7 +67648,7 @@ public function filter_script_module_interactivity_data(array $data) : array * * @param string $store_namespace Optional. The unique store namespace identifier. */ - public function get_context(?string $store_namespace = \null) : array + public function get_context(?string $store_namespace = \null): array { } /** @@ -67630,7 +67660,7 @@ public function get_context(?string $store_namespace = \null) : array * * @return array{attributes: array}|null Current element. */ - public function get_element() : ?array + public function get_element(): ?array { } /** @@ -67660,7 +67690,7 @@ public function add_hooks() * @param string $html The HTML content to process. * @return string The processed HTML content. It returns the original content when the HTML contains unbalanced tags. */ - public function process_directives(string $html) : string + public function process_directives(string $html): string { } /** @@ -67700,7 +67730,7 @@ final class WP_Translation_Controller * * @return WP_Translation_Controller */ - public static function get_instance() : \WP_Translation_Controller + public static function get_instance(): \WP_Translation_Controller { } /** @@ -67710,7 +67740,7 @@ public static function get_instance() : \WP_Translation_Controller * * @return string Locale. */ - public function get_locale() : string + public function get_locale(): string { } /** @@ -67733,7 +67763,7 @@ public function set_locale(string $locale) * @param string $locale Optional. Locale. Default current locale. * @return bool True on success, false otherwise. */ - public function load_file(string $translation_file, string $textdomain = 'default', ?string $locale = \null) : bool + public function load_file(string $translation_file, string $textdomain = 'default', ?string $locale = \null): bool { } /** @@ -67746,7 +67776,7 @@ public function load_file(string $translation_file, string $textdomain = 'defaul * @param string $locale Optional. Locale. Defaults to all locales. * @return bool True on success, false otherwise. */ - public function unload_file($file, string $textdomain = 'default', ?string $locale = \null) : bool + public function unload_file($file, string $textdomain = 'default', ?string $locale = \null): bool { } /** @@ -67758,7 +67788,7 @@ public function unload_file($file, string $textdomain = 'default', ?string $loca * @param string $locale Optional. Locale. Defaults to all locales. * @return bool True on success, false otherwise. */ - public function unload_textdomain(string $textdomain = 'default', ?string $locale = \null) : bool + public function unload_textdomain(string $textdomain = 'default', ?string $locale = \null): bool { } /** @@ -67770,7 +67800,7 @@ public function unload_textdomain(string $textdomain = 'default', ?string $local * @param string $locale Optional. Locale. Default current locale. * @return bool True if there are any loaded translations, false otherwise. */ - public function is_textdomain_loaded(string $textdomain = 'default', ?string $locale = \null) : bool + public function is_textdomain_loaded(string $textdomain = 'default', ?string $locale = \null): bool { } /** @@ -67822,7 +67852,7 @@ public function translate_plural(array $plurals, int $number, string $context = * @param string $textdomain Optional. Text domain. Default 'default'. * @return array Headers. */ - public function get_headers(string $textdomain = 'default') : array + public function get_headers(string $textdomain = 'default'): array { } /** @@ -67833,7 +67863,7 @@ public function get_headers(string $textdomain = 'default') : array * @param string $textdomain Optional. Text domain. Default 'default'. * @return array Entries. */ - public function get_entries(string $textdomain = 'default') : array + public function get_entries(string $textdomain = 'default'): array { } /** @@ -67846,7 +67876,7 @@ public function get_entries(string $textdomain = 'default') : array * @param ?string $locale Optional. Locale. Default current locale. * @return bool True if the translation exists, false otherwise. */ - public function has_translation(string $singular, string $textdomain = 'default', ?string $locale = \null) : bool + public function has_translation(string $singular, string $textdomain = 'default', ?string $locale = \null): bool { } } @@ -67940,7 +67970,7 @@ public static function transform(string $file, string $filetype) * * @return array Headers. */ - public function headers() : array + public function headers(): array { } /** @@ -67950,7 +67980,7 @@ public function headers() : array * * @return array Entries. */ - public function entries() : array + public function entries(): array { } /** @@ -67970,7 +68000,7 @@ public function error() * * @return string File name. */ - public function get_file() : string + public function get_file(): string { } /** @@ -67992,7 +68022,7 @@ public function translate(string $text) * @param int $number Count. * @return int Plural form. */ - public function get_plural_form(int $number) : int + public function get_plural_form(int $number): int { } /** @@ -68003,7 +68033,7 @@ public function get_plural_form(int $number) : int * @param string $header Plural-Forms header string. * @return string Plural forms expression. */ - protected function get_plural_expression_from_header(string $header) : string + protected function get_plural_expression_from_header(string $header): string { } /** @@ -68015,7 +68045,7 @@ protected function get_plural_expression_from_header(string $header) : string * @param string $expression Plural form expression. * @return callable(int $num): int Plural forms function. */ - protected function make_plural_form_function(string $expression) : callable + protected function make_plural_form_function(string $expression): callable { } /** @@ -68026,7 +68056,7 @@ protected function make_plural_form_function(string $expression) : callable * @param WP_Translation_File $source Source file. * @return bool True on success, false otherwise. */ - protected function import(\WP_Translation_File $source) : bool + protected function import(\WP_Translation_File $source): bool { } /** @@ -68034,7 +68064,7 @@ protected function import(\WP_Translation_File $source) : bool * * @since 6.5.0 */ - protected abstract function parse_file(); + abstract protected function parse_file(); /** * Exports translation contents as a string. * @@ -68042,7 +68072,7 @@ protected abstract function parse_file(); * * @return string Translation file contents. */ - public abstract function export(); + abstract public function export(); } /** * Class WP_Translation_File_MO. @@ -68087,7 +68117,7 @@ protected function detect_endian_and_validate_file(string $header) * * @return bool True on success, false otherwise. */ - protected function parse_file() : bool + protected function parse_file(): bool { } /** @@ -68097,7 +68127,7 @@ protected function parse_file() : bool * * @return string Translation file contents. */ - public function export() : string + public function export(): string { } } @@ -68124,7 +68154,7 @@ protected function parse_file() * * @return string Translation file contents. */ - public function export() : string + public function export(): string { } } @@ -75127,7 +75157,7 @@ protected function get_transient_key($query_args) */ class WP_REST_Plugins_Controller extends \WP_REST_Controller { - const PATTERN = '[^.\\/]+(?:\\/[^.\\/]+)?'; + const PATTERN = '[^.\/]+(?:\/[^.\/]+)?'; /** * Plugins controller constructor. * @@ -76783,7 +76813,7 @@ class WP_REST_Themes_Controller extends \WP_REST_Controller * Matches theme's directory: `/themes///` or `/themes//`. * Excludes invalid directory name characters: `/:<>*?"|`. */ - const PATTERN = '[^\\/:<>\\*\\?"\\|]+(?:\\/[^\\/:<>\\*\\?"\\|]+)?'; + const PATTERN = '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?'; /** * Constructor. * @@ -77321,7 +77351,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(#[\SensitiveParameter] $value, $request, $param) + public function check_user_password( + #[\SensitiveParameter] + $value, + $request, + $param + ) { } /** @@ -77797,7 +77832,7 @@ abstract class WP_REST_Meta_Fields * @return string One of 'post', 'comment', 'term', 'user', or anything * else supported by `_get_meta_table()`. */ - protected abstract function get_meta_type(); + abstract protected function get_meta_type(); /** * Retrieves the object meta subtype. * @@ -77815,7 +77850,7 @@ protected function get_meta_subtype() * * @return string The REST field type, such as post type name, taxonomy name, 'comment', or `user`. */ - protected abstract function get_rest_field_type(); + abstract protected function get_rest_field_type(); /** * Registers the meta field. * @@ -78261,7 +78296,7 @@ public function get_subtypes() * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the * total count for the matching search results. */ - public abstract function search_items(\WP_REST_Request $request); + abstract public function search_items(\WP_REST_Request $request); /** * Prepares the search result for a given ID. * @@ -78272,7 +78307,7 @@ public abstract function search_items(\WP_REST_Request $request); * @param array $fields Fields to include for the item. * @return array Associative array containing all fields for the item. */ - public abstract function prepare_item($id, array $fields); + abstract public function prepare_item($id, array $fields); /** * Prepares links for the search result of a given ID. * @@ -78282,7 +78317,7 @@ public abstract function prepare_item($id, array $fields); * @param int|string $id Item ID. * @return array Links for the given item. */ - public abstract function prepare_item_links($id); + abstract public function prepare_item_links($id); } /** * Core class representing a search handler for post formats in the REST API. @@ -78619,7 +78654,7 @@ abstract class WP_Sitemaps_Provider * @param string $object_subtype Optional. Object subtype name. Default empty. * @return array[] Array of URL information for a sitemap. */ - public abstract function get_url_list($page_num, $object_subtype = ''); + abstract public function get_url_list($page_num, $object_subtype = ''); /** * Gets the max number of pages available for the object type. * @@ -78628,7 +78663,7 @@ public abstract function get_url_list($page_num, $object_subtype = ''); * @param string $object_subtype Optional. Object subtype. Default empty. * @return int Total number of pages. */ - public abstract function get_max_num_pages($object_subtype = ''); + abstract public function get_max_num_pages($object_subtype = ''); /** * Gets data about each sitemap type. * @@ -80385,7 +80420,7 @@ public function update($new_instance, $old_instance) * * @param array $instance Widget instance props. */ - public abstract function render_media($instance); + abstract public function render_media($instance); /** * Outputs the settings update form. * @@ -80397,7 +80432,7 @@ public abstract function render_media($instance); * * @param array $instance Current settings. */ - public final function form($instance) + final public function form($instance) { } /** @@ -91424,7 +91459,16 @@ function wp_get_auto_update_message() * password_message: string, * } */ - function wp_install($blog_title, $user_name, $user_email, $is_public, $deprecated = '', #[\SensitiveParameter] $user_password = '', $language = '') + function wp_install( + $blog_title, + $user_name, + $user_email, + $is_public, + $deprecated = '', + #[\SensitiveParameter] + $user_password = '', + $language = '' + ) { } /** @@ -91472,7 +91516,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, #[\SensitiveParameter] $password) + function wp_new_blog_notification( + $blog_title, + $blog_url, + $user_id, + #[\SensitiveParameter] + $password + ) { } /** @@ -107392,7 +107442,7 @@ function wp_render_elements_support($block_content, $block) * @param array $parsed_block The parsed block. * @return array The same parsed block. */ - function wp_interactivity_process_directives_of_interactive_blocks(array $parsed_block) : array + function wp_interactivity_process_directives_of_interactive_blocks(array $parsed_block): array { } /** @@ -114333,7 +114383,10 @@ function wp_is_heic_image_mime_type($mime_type) * @return string The hash of the message. * @phpstan-return non-falsy-string */ - function wp_fast_hash(#[\SensitiveParameter] string $message) : string + function wp_fast_hash( + #[\SensitiveParameter] + string $message + ): string { } /** @@ -114351,7 +114404,11 @@ function wp_fast_hash(#[\SensitiveParameter] 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(#[\SensitiveParameter] string $message, string $hash) : bool + function wp_verify_fast_hash( + #[\SensitiveParameter] + string $message, + string $hash + ): bool { } /** @@ -114370,7 +114427,7 @@ function wp_verify_fast_hash(#[\SensitiveParameter] string $message, string $has * @phpstan-param non-empty-array $data * @phpstan-return ($prefix is lowercase-string ? lowercase-string&non-falsy-string : non-falsy-string) */ - function wp_unique_id_from_values(array $data, string $prefix = '') : string + function wp_unique_id_from_values(array $data, string $prefix = ''): string { } /** @@ -117476,7 +117533,7 @@ function wp_update_https_migration_required($old_url, $new_url) * * @return WP_Interactivity_API The main WP_Interactivity_API instance. */ - function wp_interactivity() : \WP_Interactivity_API + function wp_interactivity(): \WP_Interactivity_API { } /** @@ -117488,7 +117545,7 @@ function wp_interactivity() : \WP_Interactivity_API * @param string $html The HTML content to process. * @return string The processed HTML content. It returns the original content when the HTML contains unbalanced tags. */ - function wp_interactivity_process_directives(string $html) : string + function wp_interactivity_process_directives(string $html): string { } /** @@ -117510,7 +117567,7 @@ function wp_interactivity_process_directives(string $html) : string * @return array The state for the specified store namespace. This will be the updated state if a $state argument was * provided. */ - function wp_interactivity_state(?string $store_namespace = \null, array $state = array()) : array + function wp_interactivity_state(?string $store_namespace = \null, array $state = array()): array { } /** @@ -117528,7 +117585,7 @@ function wp_interactivity_state(?string $store_namespace = \null, array $state = * @return array The configuration for the specified store namespace. This will be the updated configuration if a * $config argument was provided. */ - function wp_interactivity_config(string $store_namespace, array $config = array()) : array + function wp_interactivity_config(string $store_namespace, array $config = array()): array { } /** @@ -117550,7 +117607,7 @@ function wp_interactivity_config(string $store_namespace, array $config = array( * @return string A complete `data-wp-context` directive with a JSON encoded value representing the context array and * the store namespace if specified. */ - function wp_interactivity_data_wp_context(array $context, string $store_namespace = '') : string + function wp_interactivity_data_wp_context(array $context, string $store_namespace = ''): string { } /** @@ -117567,7 +117624,7 @@ function wp_interactivity_data_wp_context(array $context, string $store_namespac * @param string $store_namespace Optional. The unique store namespace identifier. * @return array The context for the specified store namespace. */ - function wp_interactivity_get_context(?string $store_namespace = \null) : array + function wp_interactivity_get_context(?string $store_namespace = \null): array { } /** @@ -117579,7 +117636,7 @@ function wp_interactivity_get_context(?string $store_namespace = \null) : array * * @return array{attributes: array}|null Current element. */ - function wp_interactivity_get_element() : ?array + function wp_interactivity_get_element(): ?array { } function get_file($path) @@ -119221,7 +119278,7 @@ function wp_get_word_count_type() * @param ?string $locale Optional. Locale. Default current locale. * @return bool True if the translation exists, false otherwise. */ - function has_translation(string $singular, string $textdomain = 'default', ?string $locale = \null) : bool + function has_translation(string $singular, string $textdomain = 'default', ?string $locale = \null): bool { } /** @@ -122726,7 +122783,7 @@ function wp_filter_content_tags($content, $context = \null) * @param string $image The image tag markup being filtered. * @return string The filtered image tag markup. */ - function wp_img_tag_add_auto_sizes(string $image) : string + function wp_img_tag_add_auto_sizes(string $image): string { } /** @@ -122739,7 +122796,7 @@ function wp_img_tag_add_auto_sizes(string $image) : string * @param string $sizes_attr The 'sizes' attribute value. * @return bool True if the 'auto' keyword is present, false otherwise. */ - function wp_sizes_attribute_includes_valid_auto(string $sizes_attr) : bool + function wp_sizes_attribute_includes_valid_auto(string $sizes_attr): bool { } /** @@ -125433,7 +125490,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, #[\SensitiveParameter] $key, $meta = array()) + function wpmu_signup_blog_notification( + $domain, + $path, + $title, + $user_login, + $user_email, + #[\SensitiveParameter] + $key, + $meta = array() + ) { } /** @@ -125458,7 +125524,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, #[\SensitiveParameter] $key, $meta = array()) + function wpmu_signup_user_notification( + $user_login, + $user_email, + #[\SensitiveParameter] + $key, + $meta = array() + ) { } /** @@ -125476,7 +125548,10 @@ function wpmu_signup_user_notification($user_login, $user_email, #[\SensitivePar * @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(#[\SensitiveParameter] $key) + function wpmu_activate_signup( + #[\SensitiveParameter] + $key + ) { } /** @@ -125508,7 +125583,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, #[\SensitiveParameter] $password, $email) + function wpmu_create_user( + $user_name, + #[\SensitiveParameter] + $password, + $email + ) { } /** @@ -125608,7 +125688,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, #[\SensitiveParameter] $password, $title, $meta = array()) + function wpmu_welcome_notification( + $blog_id, + $user_id, + #[\SensitiveParameter] + $password, + $title, + $meta = array() + ) { } /** @@ -125642,7 +125729,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, #[\SensitiveParameter] $password, $meta = array()) + function wpmu_welcome_user_notification( + $user_id, + #[\SensitiveParameter] + $password, + $meta = array() + ) { } /** @@ -125831,7 +125923,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, #[\SensitiveParameter] $password, $meta) + function add_new_user_to_blog( + $user_id, + #[\SensitiveParameter] + $password, + $meta + ) { } /** @@ -128325,7 +128422,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, #[\SensitiveParameter] $password = '', $already_md5 = \false, $home = '', $siteurl = '', $remember = \false) + function wp_setcookie( + $username, + #[\SensitiveParameter] + $password = '', + $already_md5 = \false, + $home = '', + $siteurl = '', + $remember = \false + ) { } /** @@ -128373,7 +128478,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, #[\SensitiveParameter] $password, $deprecated = '') + function wp_login( + $username, + #[\SensitiveParameter] + $password, + $deprecated = '' + ) { } /** @@ -128494,7 +128604,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, #[\SensitiveParameter] $password) + function wp_authenticate( + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -128963,7 +129077,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(#[\SensitiveParameter] $password) + function wp_hash_password( + #[\SensitiveParameter] + $password + ) { } /** @@ -128988,7 +129105,12 @@ function wp_hash_password(#[\SensitiveParameter] $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(#[\SensitiveParameter] $password, $hash, $user_id = '') + function wp_check_password( + #[\SensitiveParameter] + $password, + $hash, + $user_id = '' + ) { } /** @@ -129070,7 +129192,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(#[\SensitiveParameter] $password, $user_id) + function wp_set_password( + #[\SensitiveParameter] + $password, + $user_id + ) { } /** @@ -137352,7 +137478,7 @@ function wp_remove_surrounding_empty_script_tags($contents) * * @return WP_Script_Modules The main WP_Script_Modules instance. */ - function wp_script_modules() : \WP_Script_Modules + function wp_script_modules(): \WP_Script_Modules { } /** @@ -137841,7 +137967,7 @@ function get_sitemap_url($name, $subtype_name = '', $page = 1) * loading is disabled. * @phpstan-return array{mode: 'prefetch'|'prerender', eagerness: 'conservative'|'eager'|'moderate'}|null */ - function wp_get_speculation_rules_configuration() : ?array + function wp_get_speculation_rules_configuration(): ?array { } /** @@ -137859,7 +137985,7 @@ function wp_get_speculation_rules_configuration() : ?array * @return WP_Speculation_Rules|null Object representing the speculation rules to use, or null if speculative loading * is disabled in the current context. */ - function wp_get_speculation_rules() : ?\WP_Speculation_Rules + function wp_get_speculation_rules(): ?\WP_Speculation_Rules { } /** @@ -137871,7 +137997,7 @@ function wp_get_speculation_rules() : ?\WP_Speculation_Rules * @access private * @phpstan-return void */ - function wp_print_speculation_rules() : void + function wp_print_speculation_rules(): void { } /** @@ -142019,7 +142145,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, #[\SensitiveParameter] $password) + function wp_authenticate_username_password( + $user, + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -142033,7 +142164,12 @@ function wp_authenticate_username_password($user, $username, #[\SensitiveParamet * @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, #[\SensitiveParameter] $password) + function wp_authenticate_email_password( + $user, + $email, + #[\SensitiveParameter] + $password + ) { } /** @@ -142048,7 +142184,12 @@ function wp_authenticate_email_password($user, $email, #[\SensitiveParameter] $p * @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, #[\SensitiveParameter] $password) + function wp_authenticate_cookie( + $user, + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -142063,7 +142204,12 @@ function wp_authenticate_cookie($user, $username, #[\SensitiveParameter] $passwo * @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, #[\SensitiveParameter] $password) + function wp_authenticate_application_password( + $input_user, + $username, + #[\SensitiveParameter] + $password + ) { } /** @@ -142920,7 +143066,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, #[\SensitiveParameter] $password, $email = '') + function wp_create_user( + $username, + #[\SensitiveParameter] + $password, + $email = '' + ) { } /** @@ -143001,7 +143152,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(#[\SensitiveParameter] $key, $login) + function check_password_reset_key( + #[\SensitiveParameter] + $key, + $login + ) { } /** @@ -143027,7 +143182,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, #[\SensitiveParameter] $new_pass) + function reset_password( + $user, + #[\SensitiveParameter] + $new_pass + ) { } /** @@ -143322,7 +143481,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, #[\SensitiveParameter] $key) + function wp_validate_user_request_key( + $request_id, + #[\SensitiveParameter] + $key + ) { } /** From a6fb82a55f61a083d0a7e39c63e0f8a085b80940 Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Tue, 28 Oct 2025 20:00:13 +0100 Subject: [PATCH 2/3] Narrow return type of add_feed() --- functionMap.php | 1 + tests/data/return/add-feed.php | 13 +++++++++++++ wordpress-stubs.php | 1 + 3 files changed, 15 insertions(+) create mode 100644 tests/data/return/add-feed.php diff --git a/functionMap.php b/functionMap.php index 85de493..4f6835d 100644 --- a/functionMap.php +++ b/functionMap.php @@ -40,6 +40,7 @@ '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', '@phpstan-pure' => ''], 'add_comments_page' => [null, 'callback' => "''|callable"], 'add_dashboard_page' => [null, 'callback' => "''|callable"], + 'add_feed' => ['non-falsy-string'], 'add_link' => ['int<0, max>'], 'add_links_page' => [null, 'callback' => "''|callable"], 'add_management_page' => [null, 'callback' => "''|callable"], diff --git a/tests/data/return/add-feed.php b/tests/data/return/add-feed.php new file mode 100644 index 0000000..1ca7c9f --- /dev/null +++ b/tests/data/return/add-feed.php @@ -0,0 +1,13 @@ + Date: Tue, 28 Oct 2025 22:14:04 +0100 Subject: [PATCH 3/3] Narrow parameter type for add_feed() --- functionMap.php | 2 +- tests/Faker.php | 4 +++- tests/ParameterTypeTest.php | 16 ++++++++++++++++ tests/data/param/add-feed.php | 33 +++++++++++++++++++++++++++++++++ wordpress-stubs.php | 1 + 5 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 tests/data/param/add-feed.php diff --git a/functionMap.php b/functionMap.php index 4f6835d..59ea17c 100644 --- a/functionMap.php +++ b/functionMap.php @@ -40,7 +40,7 @@ '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', '@phpstan-pure' => ''], 'add_comments_page' => [null, 'callback' => "''|callable"], 'add_dashboard_page' => [null, 'callback' => "''|callable"], - 'add_feed' => ['non-falsy-string'], + 'add_feed' => ['non-falsy-string', 'callback' => 'callable(bool, string): void'], 'add_link' => ['int<0, max>'], 'add_links_page' => [null, 'callback' => "''|callable"], 'add_management_page' => [null, 'callback' => "''|callable"], diff --git a/tests/Faker.php b/tests/Faker.php index 0358f9f..f8f09f4 100644 --- a/tests/Faker.php +++ b/tests/Faker.php @@ -104,10 +104,12 @@ public static function list($type = null): array * @param TKeyOrValue $keyOrValueType * @param TValue $valueType * @return (TKeyOrValue is null ? non-empty-array : (TValue is null ? non-empty-array : non-empty-array)) + * + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed */ public static function nonEmptyArray($keyOrValueType = null, $valueType = null): array { - return [$keyOrValueType => $valueType]; + return ['non-empty']; } /** diff --git a/tests/ParameterTypeTest.php b/tests/ParameterTypeTest.php index c6a615e..cad087a 100644 --- a/tests/ParameterTypeTest.php +++ b/tests/ParameterTypeTest.php @@ -28,6 +28,22 @@ public function testAbsint(): void ); } + public function testAddFeed(): void + { + $this->analyse( + __DIR__ . '/data/param/add-feed.php', + [ + ["Parameter #2 \$callback of function add_feed expects callable(bool, string): void, '' given.", 19], + ['Parameter #2 $callback of function add_feed expects callable(bool, string): void, Closure(int): void given.', 20], + ['Parameter #2 $callback of function add_feed expects callable(bool, string): void, Closure(bool, int): void given.', 21], + ['Parameter #2 $callback of function add_feed expects callable(bool, string): void, Closure(bool, string): int given.', 22], + ["Parameter #2 \$callback of function add_feed expects callable(bool, string): void, 'addFeedNotOkFirst' given.", 23], + ["Parameter #2 \$callback of function add_feed expects callable(bool, string): void, 'addFeedNotOkSecond' given.", 24], + ["Parameter #2 \$callback of function add_feed expects callable(bool, string): void, 'addFeedNotOkReturn' given.", 25], + ] + ); + } + public function testAddMenuPage(): void { $this->analyse( diff --git a/tests/data/param/add-feed.php b/tests/data/param/add-feed.php new file mode 100644 index 0000000..b21bfcf --- /dev/null +++ b/tests/data/param/add-feed.php @@ -0,0 +1,33 @@ +