diff --git a/src/wp-admin/includes/class-wp-ms-themes-list-table.php b/src/wp-admin/includes/class-wp-ms-themes-list-table.php index 81c35414d9053..eb49de155107c 100644 --- a/src/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -724,7 +724,7 @@ public function column_description( $theme ) { $pre . $theme->errors()->get_error_message(), array( 'type' => 'error', - 'additional_classes' => 'inline', + 'additional_classes' => array( 'inline' ), ) ); } diff --git a/src/wp-content/themes/twentynineteen/inc/template-tags.php b/src/wp-content/themes/twentynineteen/inc/template-tags.php index 63e9f78e1b505..c884a71621f01 100644 --- a/src/wp-content/themes/twentynineteen/inc/template-tags.php +++ b/src/wp-content/themes/twentynineteen/inc/template-tags.php @@ -209,7 +209,7 @@ function twentynineteen_comment_form( $order ) { comment_form( array( - 'title_reply' => null, + 'title_reply' => '', ) ); } diff --git a/src/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php b/src/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php index 83c3c8c47cfe5..4355afe64bed9 100644 --- a/src/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php +++ b/src/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php @@ -70,7 +70,7 @@ 'depth' => 1, 'link_before' => '', 'link_after' => '', - 'fallback_cb' => '', + 'fallback_cb' => false, ) ); ?> diff --git a/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php b/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php index f157f5159b946..139f00ae1ac13 100644 --- a/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php +++ b/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php @@ -129,7 +129,7 @@ 'depth' => 1, 'link_before' => '', 'link_after' => '', - 'fallback_cb' => '', + 'fallback_cb' => false, ) ); ?> diff --git a/src/wp-includes/bookmark.php b/src/wp-includes/bookmark.php index d4b597843820d..9e44d781909ed 100644 --- a/src/wp-includes/bookmark.php +++ b/src/wp-includes/bookmark.php @@ -108,28 +108,29 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) { * @param string|array $args { * Optional. String or array of arguments to retrieve bookmarks. * - * @type string $orderby How to order the links by. Accepts 'id', 'link_id', 'name', 'link_name', - * 'url', 'link_url', 'visible', 'link_visible', 'rating', 'link_rating', - * 'owner', 'link_owner', 'updated', 'link_updated', 'notes', 'link_notes', - * 'description', 'link_description', 'length' and 'rand'. - * When `$orderby` is 'length', orders by the character length of - * 'link_name'. Default 'name'. - * @type string $order Whether to order bookmarks in ascending or descending order. - * Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'. - * @type int $limit Amount of bookmarks to display. Accepts any positive number or - * -1 for all. Default -1. - * @type string $category Comma-separated list of category IDs to include links from. - * Default empty. - * @type string $category_name Category to retrieve links for by name. Default empty. - * @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts - * 1|true or 0|false. Default 1|true. - * @type int|bool $show_updated Whether to display the time the bookmark was last updated. - * Accepts 1|true or 0|false. Default 0|false. - * @type string $include Comma-separated list of bookmark IDs to include. Default empty. - * @type string $exclude Comma-separated list of bookmark IDs to exclude. Default empty. - * @type string $search Search terms. Will be SQL-formatted with wildcards before and after - * and searched in 'link_url', 'link_name' and 'link_description'. - * Default empty. + * @type string $orderby How to order the links by. Accepts 'id', 'link_id', 'name', 'link_name', + * 'url', 'link_url', 'visible', 'link_visible', 'rating', 'link_rating', + * 'owner', 'link_owner', 'updated', 'link_updated', 'notes', 'link_notes', + * 'description', 'link_description', 'length' and 'rand'. + * When `$orderby` is 'length', orders by the character length of + * 'link_name'. Default 'name'. + * @type string $order Whether to order bookmarks in ascending or descending order. + * Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'. + * @type int $limit Amount of bookmarks to display. Accepts any positive number or + * -1 for all. Default -1. + * @type int|string $category A category ID, or a comma-separated list of category IDs to include + * links from. Ignored if `$category_name` is passed. Default empty. + * @type string $category_name Category to retrieve links for by name. Takes precedence over + * `$category`. Default empty. + * @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts + * 1|true or 0|false. Default 1|true. + * @type int|bool $show_updated Whether to display the time the bookmark was last updated. + * Accepts 1|true or 0|false. Default 0|false. + * @type string $include Comma-separated list of bookmark IDs to include. Default empty. + * @type string $exclude Comma-separated list of bookmark IDs to exclude. Default empty. + * @type string $search Search terms. Will be SQL-formatted with wildcards before and after + * and searched in 'link_url', 'link_name' and 'link_description'. + * Default empty. * } * @return object[] List of bookmark row objects. */ diff --git a/src/wp-includes/class-wp-ajax-response.php b/src/wp-includes/class-wp-ajax-response.php index ed996a19de0dd..ab747618e0fbf 100644 --- a/src/wp-includes/class-wp-ajax-response.php +++ b/src/wp-includes/class-wp-ajax-response.php @@ -46,21 +46,21 @@ public function __construct( $args = '' ) { * @param string|array $args { * Optional. An array or string of XML response arguments. * - * @type string $what XML-RPC response type. Used as a child element of ``. - * Default 'object' (``). - * @type string|false $action Value to use for the `action` attribute in ``. Will be - * appended with `_$id` on output. If false, `$action` will default to - * the value of `$_POST['action']`. Default false. - * @type int|WP_Error $id The response ID, used as the response type `id` attribute. Also - * accepts a `WP_Error` object if the ID does not exist. Default 0. - * @type int|false $old_id The previous response ID. Used as the value for the response type - * `old_id` attribute. False hides the attribute. Default false. - * @type string $position Value of the response type `position` attribute. Accepts 1 (bottom), - * -1 (top), HTML ID (after), or -HTML ID (before). Default 1 (bottom). - * @type string|WP_Error $data The response content/message. Also accepts a WP_Error object if the - * ID does not exist. Default empty. - * @type array $supplemental An array of extra strings that will be output within a `` - * element as CDATA. Default empty array. + * @type string $what XML-RPC response type. Used as a child element of ``. + * Default 'object' (``). + * @type string|false $action Value to use for the `action` attribute in ``. Will be + * appended with `_$id` on output. If false, `$action` will default to + * the value of `$_POST['action']`. Default false. + * @type int|string|WP_Error $id The response ID, used as the response type `id` attribute. Also + * accepts a `WP_Error` object if the ID does not exist. Default 0. + * @type int|false $old_id The previous response ID. Used as the value for the response type + * `old_id` attribute. False hides the attribute. Default false. + * @type int|string $position Value of the response type `position` attribute. Accepts 1 (bottom), + * -1 (top), HTML ID (after), or -HTML ID (before). Default 1 (bottom). + * @type string|WP_Error $data The response content/message. Also accepts a WP_Error object if the + * ID does not exist. Default empty. + * @type array $supplemental An array of extra strings that will be output within a `` + * element as CDATA. Default empty array. * } * @return string XML response. */ diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 6ee4292496aa6..02dd558ea24cd 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -5816,7 +5816,7 @@ public function has_published_pages() { get_pages( array( 'number' => 1, - 'hierarchical' => 0, + 'hierarchical' => false, ) ) ); diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index 2586646f7f2e1..68dd8b1433857 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -68,7 +68,7 @@ class WP_Customize_Setting { * The default value for the setting. * * @since 3.4.0 - * @var string + * @var mixed */ public $default = ''; @@ -168,7 +168,7 @@ class WP_Customize_Setting { * @type string $type Type of the setting. Default 'theme_mod'. * @type string $capability Capability required for the setting. Default 'edit_theme_options' * @type string|string[] $theme_supports Theme features required to support the panel. Default is none. - * @type string $default Default value for the setting. Default is empty string. + * @type mixed $default Default value for the setting. Default is empty string. * @type string $transport Options for rendering the live preview of changes in Customizer. * Using 'refresh' makes the change visible by reloading the whole preview. * Using 'postMessage' allows a custom JavaScript to handle live changes. @@ -178,7 +178,7 @@ class WP_Customize_Setting { * @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is * JSON serializable. * @type bool $dirty Whether or not the setting is initially dirty when created. - * } + * } */ public function __construct( $manager, $id, $args = array() ) { $keys = array_keys( get_object_vars( $this ) ); diff --git a/src/wp-includes/nav-menu-template.php b/src/wp-includes/nav-menu-template.php index fc07e6fd2c79a..bad702e35d081 100644 --- a/src/wp-includes/nav-menu-template.php +++ b/src/wp-includes/nav-menu-template.php @@ -31,7 +31,7 @@ * Default 'menu'. * @type string $menu_id The ID that is applied to the ul element which forms the menu. * Default is the menu slug, incremented. - * @type string $container Whether to wrap the ul, and what to wrap it with. + * @type string|false $container Whether to wrap the ul, and what to wrap it with. * Default 'div'. * @type string $container_class Class that is applied to the container. * Default 'menu-{menu slug}-container'. @@ -55,7 +55,7 @@ * numbered placeholders. Default is a ul with an id and class. * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. * Accepts 'preserve' or 'discard'. Default 'preserve'. - * } + * } * @return void|string|false Void if 'echo' argument is true, menu output if 'echo' is false. * False if there are no items or no menu was found. */ diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index cb693fb48517f..ea06ad3b64a7b 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1272,31 +1272,31 @@ function wp_dropdown_pages( $args = '' ) { * @param array|string $args { * Optional. Array or string of arguments to generate a list of pages. See get_pages() for additional arguments. * - * @type int $child_of Display only the sub-pages of a single page by ID. Default 0 (all pages). - * @type string $authors Comma-separated list of author IDs. Default empty (all authors). - * @type string $date_format PHP date format to use for the listed pages. Relies on the 'show_date' parameter. - * Default is the value of 'date_format' option. - * @type int $depth Number of levels in the hierarchy of pages to include in the generated list. - * Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to - * the given n depth). Default 0. - * @type bool $echo Whether or not to echo the list of pages. Default true. - * @type string $exclude Comma-separated list of page IDs to exclude. Default empty. - * @type array $include Comma-separated list of page IDs to include. Default empty. - * @type string $link_after Text or HTML to follow the page link label. Default null. - * @type string $link_before Text or HTML to precede the page link label. Default null. - * @type string $post_type Post type to query for. Default 'page'. - * @type string|array $post_status Comma-separated list or array of post statuses to include. Default 'publish'. - * @type string $show_date Whether to display the page publish or modified date for each page. Accepts - * 'modified' or any other value. An empty value hides the date. Default empty. - * @type string $sort_column Comma-separated list of column names to sort the pages by. Accepts 'post_author', - * 'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt', - * 'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'. - * @type string $title_li List heading. Passing a null or empty value will result in no heading, and the list - * will not be wrapped with unordered list `
    ` tags. Default 'Pages'. - * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. - * Default 'preserve'. - * @type Walker $walker Walker instance to use for listing pages. Default empty which results in a - * Walker_Page instance being used. + * @type int $child_of Display only the sub-pages of a single page by ID. Default 0 (all pages). + * @type string $authors Comma-separated list of author IDs. Default empty (all authors). + * @type string $date_format PHP date format to use for the listed pages. Relies on the 'show_date' parameter. + * Default is the value of 'date_format' option. + * @type int $depth Number of levels in the hierarchy of pages to include in the generated list. + * Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to + * the given n depth). Default 0. + * @type bool $echo Whether or not to echo the list of pages. Default true. + * @type string $exclude Comma-separated list of page IDs to exclude. Default empty. + * @type array $include Comma-separated list of page IDs to include. Default empty. + * @type string $link_after Text or HTML to follow the page link label. Default null. + * @type string $link_before Text or HTML to precede the page link label. Default null. + * @type string $post_type Post type to query for. Default 'page'. + * @type string|array $post_status Comma-separated list or array of post statuses to include. Default 'publish'. + * @type string $show_date Whether to display the page publish or modified date for each page. Accepts + * 'modified' or any other value. An empty value hides the date. Default empty. + * @type string $sort_column Comma-separated list of column names to sort the pages by. Accepts 'post_author', + * 'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt', + * 'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'. + * @type string|false|null $title_li List heading. Passing a null or empty value will result in no heading, and the list + * will not be wrapped with unordered list `
      ` tags. Default 'Pages'. + * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. + * Default 'preserve'. + * @type Walker $walker Walker instance to use for listing pages. Default empty which results in a + * Walker_Page instance being used. * } * @return void|string Void if 'echo' argument is true, HTML list of pages if 'echo' is false. */ diff --git a/tests/phpstan/baselines/assign.propertyType.neon b/tests/phpstan/baselines/assign.propertyType.neon index 82723fce7732a..d3dbb32a54dcf 100644 --- a/tests/phpstan/baselines/assign.propertyType.neon +++ b/tests/phpstan/baselines/assign.propertyType.neon @@ -38,11 +38,6 @@ parameters: identifier: assign.propertyType count: 1 path: ../../../src/wp-includes/class-wp-customize-control.php - - - message: '#^Property WP_Customize_Setting\:\:\$default \(string\) does not accept stdClass\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../src/wp-includes/class-wp-customize-setting.php - message: '#^Property WP_Image_Editor_Imagick\:\:\$image \(Imagick\) does not accept null\.$#' identifier: assign.propertyType diff --git a/tests/phpstan/baselines/property.phpDocType.neon b/tests/phpstan/baselines/property.phpDocType.neon index 2f69939d19f8b..ed63b931d2013 100644 --- a/tests/phpstan/baselines/property.phpDocType.neon +++ b/tests/phpstan/baselines/property.phpDocType.neon @@ -18,16 +18,6 @@ parameters: ignoreErrors: - - - message: '#^PHPDoc type array of property WP_Customize_Nav_Menu_Item_Setting\:\:\$default is not covariant with PHPDoc type string of overridden property WP_Customize_Setting\:\:\$default\.$#' - identifier: property.phpDocType - count: 1 - path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php - - - message: '#^PHPDoc type array of property WP_Customize_Nav_Menu_Setting\:\:\$default is not covariant with PHPDoc type string of overridden property WP_Customize_Setting\:\:\$default\.$#' - identifier: property.phpDocType - count: 1 - path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-setting.php - message: '#^PHPDoc type false of property WP_REST_Attachments_Controller\:\:\$allow_batch is not covariant with PHPDoc type array of overridden property WP_REST_Posts_Controller\:\:\$allow_batch\.$#' identifier: property.phpDocType