diff --git a/lib/block-supports/block-style-variations.php b/lib/block-supports/block-style-variations.php index b1f3243bfd04d1..dbc27af5ba922b 100644 --- a/lib/block-supports/block-style-variations.php +++ b/lib/block-supports/block-style-variations.php @@ -38,7 +38,7 @@ function gutenberg_get_block_style_variation_name_from_class( $class_string ) { } preg_match_all( '/\bis-style-(?!default)(\S+)\b/', $class_string, $matches ); - return $matches[1] ?? null; + return ! empty( $matches[1] ) ? $matches[1] : null; } /** @@ -273,7 +273,7 @@ function gutenberg_enqueue_block_style_variation_styles() { } // Add Gutenberg filters and action. -add_filter( 'render_block_data', 'gutenberg_render_block_style_variation_support_styles', 10, 2 ); +add_filter( 'render_block_data', 'gutenberg_render_block_style_variation_support_styles' ); add_filter( 'render_block', 'gutenberg_render_block_style_variation_class_name', 10, 2 ); add_action( 'wp_enqueue_scripts', 'gutenberg_enqueue_block_style_variation_styles', 1 ); diff --git a/lib/block-supports/duotone.php b/lib/block-supports/duotone.php index 98791fe05c1096..0f7573807dfab8 100644 --- a/lib/block-supports/duotone.php +++ b/lib/block-supports/duotone.php @@ -80,7 +80,7 @@ function gutenberg_tinycolor_bound01( $n, $max ) { _deprecated_function( __FUNCTION__, '6.3.0' ); - if ( 'string' === gettype( $n ) && str_contains( $n, '.' ) && 1 === (float) $n ) { + if ( 'string' === gettype( $n ) && str_contains( $n, '.' ) && 1.0 === (float) $n ) { $n = '100%'; } @@ -309,7 +309,7 @@ function gutenberg_tinycolor_string_to_rgb( $color_str ) { ); $rgb['a'] = gutenberg_tinycolor_bound_alpha( - base_convert( $match[4], 16, 10 ) / 255 + absint( base_convert( $match[4], 16, 10 ) ) / 255 ); return $rgb; @@ -341,7 +341,7 @@ function gutenberg_tinycolor_string_to_rgb( $color_str ) { ); $rgb['a'] = gutenberg_tinycolor_bound_alpha( - base_convert( $match[4] . $match[4], 16, 10 ) / 255 + absint( base_convert( $match[4] . $match[4], 16, 10 ) ) / 255 ); return $rgb; diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index 7d63074ccb09bb..d00b130794fedd 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -656,7 +656,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { $column_start_number = floatval( $column_start ); $parent_column_width = $minimum_column_width ? $minimum_column_width : '12rem'; $parent_column_value = floatval( $parent_column_width ); - $parent_column_unit = explode( $parent_column_value, $parent_column_width ); + $parent_column_unit = explode( (string) $parent_column_value, $parent_column_width ); $num_cols_to_break_at = 2; if ( $column_span_number && $column_start_number ) { diff --git a/lib/block-supports/shadow.php b/lib/block-supports/shadow.php index 25c365067e0c32..501857cb715824 100644 --- a/lib/block-supports/shadow.php +++ b/lib/block-supports/shadow.php @@ -21,13 +21,13 @@ function gutenberg_register_shadow_support( $block_type ) { $block_type->attributes = array(); } - if ( $has_shadow_support && ! array_key_exists( 'style', $block_type->attributes ) ) { + if ( ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } - if ( $has_shadow_support && ! array_key_exists( 'shadow', $block_type->attributes ) ) { + if ( ! array_key_exists( 'shadow', $block_type->attributes ) ) { $block_type->attributes['shadow'] = array( 'type' => 'string', ); diff --git a/lib/block-supports/typography.php b/lib/block-supports/typography.php index a4719b7bdd4099..5c101e843c7e16 100644 --- a/lib/block-supports/typography.php +++ b/lib/block-supports/typography.php @@ -277,7 +277,7 @@ function gutenberg_render_typography_support( $block_content, $block ) { * @type int $root_size_value Value of root font size for rem|em <-> px conversion. Default `16`. * @type array $acceptable_units An array of font size units. Default `[ 'rem', 'px', 'em' ]`; * } - * @return array An array consisting of `'value'` and `'unit'` properties. + * @return ?array An array consisting of `'value'` and `'unit'` properties. */ function gutenberg_get_typography_value_and_unit( $raw_value, $options = array() ) { if ( ! is_string( $raw_value ) && ! is_int( $raw_value ) && ! is_float( $raw_value ) ) { diff --git a/lib/class-wp-duotone-gutenberg.php b/lib/class-wp-duotone-gutenberg.php index cc49c320da6506..69e5c452ef00af 100644 --- a/lib/class-wp-duotone-gutenberg.php +++ b/lib/class-wp-duotone-gutenberg.php @@ -172,10 +172,8 @@ private static function colord_parse_hue( $value, $unit = 'deg' ) { 'rad' => 360 / ( M_PI * 2 ), ); - $factor = $angle_units[ $unit ]; - if ( ! $factor ) { - $factor = 1; - } + // If the unit is not recognized, default to degrees. + $factor = $angle_units[ $unit ] ?? 1; return (float) $value * $factor; } @@ -206,7 +204,7 @@ private static function colord_parse_hex( $hex ) { 'r' => (int) base_convert( $hex[0] . $hex[0], 16, 10 ), 'g' => (int) base_convert( $hex[1] . $hex[1], 16, 10 ), 'b' => (int) base_convert( $hex[2] . $hex[2], 16, 10 ), - 'a' => 4 === strlen( $hex ) ? round( base_convert( $hex[3] . $hex[3], 16, 10 ) / 255, 2 ) : 1, + 'a' => 4 === strlen( $hex ) ? round( absint( base_convert( $hex[3] . $hex[3], 16, 10 ) ) / 255, 2 ) : 1, ); } @@ -410,7 +408,7 @@ private static function colord_parse_hsla_string( $input ) { $hsla = self::colord_clamp_hsla( array( - 'h' => self::colord_parse_hue( $match[1], $match[2] ), + 'h' => self::colord_parse_hue( (float) $match[1], $match[2] ), 's' => (float) $match[3], 'l' => (float) $match[4], 'a' => '' === $match[5] ? 1 : (float) $match[5] / ( $match[6] ? 100 : 1 ), diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 3af123d96bcc5a..68c03859314baa 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -2823,12 +2823,6 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) { if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'][ $element ][ $pseudo_selector ] ) ) { $node_path = array( 'styles', 'blocks', $name, 'elements', $element ); - if ( $include_node_paths_only ) { - $nodes[] = array( - 'path' => $node_path, - ); - continue; - } $nodes[] = array( 'path' => $node_path, @@ -4325,7 +4319,7 @@ protected static function get_block_element_selectors( $root_selector ) { * typography etc, that have custom selectors in their related block's * metadata. * - * @param object $metadata The related block metadata containing selectors. + * @param array $metadata The related block metadata containing selectors. * @param object $node A merged theme.json node for block or variation. * * @return array The style declarations for the node's features with custom @@ -4483,7 +4477,7 @@ private static function convert_variables_to_value( $styles, $values ) { continue; } - if ( 0 <= strpos( $style, 'var(' ) ) { + if ( false !== strpos( $style, 'var(' ) ) { // find all the variables in the string in the form of var(--variable-name, fallback), with fallback in the second capture group. $has_matches = preg_match_all( '/var\(([^),]+)?,?\s?(\S+)?\)/', $style, $var_parts ); diff --git a/lib/class-wp-theme-json-resolver-gutenberg.php b/lib/class-wp-theme-json-resolver-gutenberg.php index 1f45d897a77cc0..729c0c2014d416 100644 --- a/lib/class-wp-theme-json-resolver-gutenberg.php +++ b/lib/class-wp-theme-json-resolver-gutenberg.php @@ -170,7 +170,7 @@ public static function get_core_data() { * * @since 6.1.0 * - * @param WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data. + * @param WP_Theme_JSON_Data_Gutenberg $instance Class to access and update the underlying data. */ $theme_json = apply_filters( 'wp_theme_json_data_default', new WP_Theme_JSON_Data_Gutenberg( $config, 'default' ) ); static::$core = $theme_json->get_theme_json(); @@ -276,7 +276,7 @@ public static function get_theme_data( $deprecated = array(), $options = array() * * @since 6.1.0 * - * @param WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data. + * @param WP_Theme_JSON_Data_Gutenberg $instance Class to access and update the underlying data. */ $theme_json = apply_filters( 'wp_theme_json_data_theme', new WP_Theme_JSON_Data_Gutenberg( $theme_json_data, 'theme' ) ); static::$theme = $theme_json->get_theme_json(); @@ -359,7 +359,7 @@ public static function get_theme_data( $deprecated = array(), $options = array() } if ( current_theme_supports( 'experimental-link-color' ) ) { _doing_it_wrong( - current_theme_supports( 'experimental-link-color' ), + "add_theme_support( 'experimental-link-color' )", __( '`experimental-link-color` is no longer supported. Use `link-color` instead.', 'gutenberg' ), '6.3.0' ); @@ -411,7 +411,7 @@ public static function get_block_data() { * * @since 6.1.0 * - * @param WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data. + * @param WP_Theme_JSON_Data_Gutenberg $instance Class to access and update the underlying data. */ $theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data_Gutenberg( $config, 'blocks' ) ); static::$blocks = $theme_json->get_theme_json(); @@ -544,7 +544,7 @@ public static function get_user_data() { * * @since 6.1.0 * - * @param WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data. + * @param WP_Theme_JSON_Data_Gutenberg $instance Class to access and update the underlying data. */ $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data_Gutenberg( $config, 'custom' ) ); diff --git a/lib/client-assets.php b/lib/client-assets.php index f95ac27f81d010..4a94ca212c3422 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -539,7 +539,7 @@ function gutenberg_enqueue_stored_styles( $options = array() ) { // Combines Core styles. if ( ! empty( $compiled_core_stylesheet ) ) { - wp_register_style( $style_tag_id, false, array(), true, true ); + wp_register_style( $style_tag_id, false, array(), true ); wp_add_inline_style( $style_tag_id, $compiled_core_stylesheet ); wp_enqueue_style( $style_tag_id ); } @@ -562,7 +562,7 @@ function gutenberg_enqueue_stored_styles( $options = array() ) { $styles = gutenberg_style_engine_get_stylesheet_from_context( $store_name, $options ); if ( ! empty( $styles ) ) { $key = "wp-style-engine-$store_name"; - wp_register_style( $key, false, array(), true, true ); + wp_register_style( $key, false, array(), true ); wp_add_inline_style( $key, $styles ); wp_enqueue_style( $key ); } diff --git a/lib/compat/wordpress-6.7/block-bindings.php b/lib/compat/wordpress-6.7/block-bindings.php index 3cecb7fbc0985c..08608a8d394e72 100644 --- a/lib/compat/wordpress-6.7/block-bindings.php +++ b/lib/compat/wordpress-6.7/block-bindings.php @@ -32,7 +32,7 @@ function gutenberg_bootstrap_server_block_bindings_sources() { /** * Initialize `canUpdateBlockBindings` editor setting if it doesn't exist. By default, it is `true` only for admin users. * - * @param array $settings The block editor settings from the `block_editor_settings_all` filter. + * @param array $editor_settings The block editor settings from the `block_editor_settings_all` filter. * @return array The editor settings including `canUpdateBlockBindings`. */ function gutenberg_add_can_update_block_bindings_editor_setting( $editor_settings ) { diff --git a/lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php b/lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php index e5f6eb126f2a6a..34c2c2a4db52d6 100644 --- a/lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php +++ b/lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php @@ -92,7 +92,7 @@ public function prepare_item_for_response( $item, $request ) { * Returns the source from where the template originally comes from. * * @param WP_Block_Template $template_object Template instance. - * @return string Original source of the template one of theme, plugin, site, or user. + * @return 'theme'|'plugin'|'site'|'user' Original source of the template one of theme. */ // @core-merge: Changed the comments format (from inline to multi-line) in the entire function. private static function get_wp_templates_original_source_field( $template_object ) { diff --git a/lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php b/lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php index a2142171ddc14f..d29cf159a9f103 100644 --- a/lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php +++ b/lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php @@ -607,7 +607,7 @@ private function read_small_token( string $text, int $offset = 0, &$matched_toke if ( $search_text[ $adjust ] !== $this->small_words[ $at + $adjust ] && - ( ! $ignore_case || strtoupper( $this->small_words[ $at + $adjust ] !== $search_text[ $adjust ] ) ) + ( ! $ignore_case || strtoupper( $this->small_words[ $at + $adjust ] ) !== $search_text[ $adjust ] ) ) { $at += $this->key_length + 1; continue 2; diff --git a/lib/compat/wordpress-6.7/compat.php b/lib/compat/wordpress-6.7/compat.php index 33c123a14860d2..98ea34c813ae43 100644 --- a/lib/compat/wordpress-6.7/compat.php +++ b/lib/compat/wordpress-6.7/compat.php @@ -73,8 +73,8 @@ function ( $registered_template ) use ( $template_files ) { /** * Hooks into `get_block_template` to add the `plugin` property when necessary. * - * @param [WP_Block_Template|null] $block_template The found block template, or null if there isn’t one. - * @return [WP_Block_Template|null] The block template that was already found with the plugin property defined if it was registered by a plugin. + * @param WP_Block_Template|null $block_template The found block template, or null if there isn’t one. + * @return WP_Block_Template|null The block template that was already found with the plugin property defined if it was registered by a plugin. */ function _gutenberg_add_block_template_plugin_attribute( $block_template ) { if ( $block_template ) { diff --git a/lib/experimental/kses-allowed-html.php b/lib/experimental/kses-allowed-html.php index 122faef7b4ca2c..9a4f2e7c614b80 100644 --- a/lib/experimental/kses-allowed-html.php +++ b/lib/experimental/kses-allowed-html.php @@ -40,4 +40,4 @@ function gutenberg_kses_allowed_html( $allowedtags ) { ); return $allowedtags; } -add_filter( 'wp_kses_allowed_html', 'gutenberg_kses_allowed_html', 10, 2 ); +add_filter( 'wp_kses_allowed_html', 'gutenberg_kses_allowed_html' ); diff --git a/lib/experimental/navigation-theme-opt-in.php b/lib/experimental/navigation-theme-opt-in.php index 547aa8b88ea7d1..6c5dbbe78c3be9 100644 --- a/lib/experimental/navigation-theme-opt-in.php +++ b/lib/experimental/navigation-theme-opt-in.php @@ -155,8 +155,8 @@ function gutenberg_remove_block_nav_menu_items( $menu_items ) { // We should uncomment the line below when the block-nav-menus feature becomes stable. // @see https://github.com/WordPress/gutenberg/issues/34265. /*if ( current_theme_supports( 'block-nav-menus' ) ) {*/ - if ( false ) { - return $menu_items; + if ( empty( $menu_items ) ) { + return []; } return array_filter( diff --git a/lib/experimental/script-modules.php b/lib/experimental/script-modules.php index 5a14e1418ed6de..9657fdad4a7254 100644 --- a/lib/experimental/script-modules.php +++ b/lib/experimental/script-modules.php @@ -55,7 +55,7 @@ function gutenberg_filter_block_type_metadata_settings_register_view_module( $se * @param string $field_name Field name to pick from metadata. * @param int $index Optional. Index of the script to register when multiple items passed. * Default 0. - * @return string Module ID. + * @return string|false Module ID. */ function gutenberg_register_block_module_id( $metadata, $field_name, $index = 0 ) { if ( empty( $metadata[ $field_name ] ) ) { diff --git a/lib/experimental/sync/class-gutenberg-http-signaling-server.php b/lib/experimental/sync/class-gutenberg-http-signaling-server.php index a41e26fdac163a..3448e82a4c31d0 100644 --- a/lib/experimental/sync/class-gutenberg-http-signaling-server.php +++ b/lib/experimental/sync/class-gutenberg-http-signaling-server.php @@ -172,7 +172,7 @@ private static function handle_read_pending_messages( $subscriber_to_messages_pa if ( ! $fd ) { $retries = isset( $_COOKIE['signaling_server_retries'] ) ? intval( $_COOKIE['signaling_server_retries'] ) : 0; $secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) ); - setcookie( 'signaling_server_retries', $retries + 1, time() + DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure ); + setcookie( 'signaling_server_retries', (string) ( $retries + 1 ), time() + DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure ); echo 'id: ' . time() . PHP_EOL; echo 'event: error' . PHP_EOL; echo 'data: ' . 'Could not open required file.' . PHP_EOL . PHP_EOL; @@ -183,7 +183,7 @@ private static function handle_read_pending_messages( $subscriber_to_messages_pa if ( isset( $_COOKIE['signaling_server_retries'] ) ) { $secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) ); // unset the cookie using a past expiration date. - setcookie( 'signaling_server_retries', 0, time() - DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure ); + setcookie( 'signaling_server_retries', '0', time() - DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure ); } echo 'retry: 3000' . PHP_EOL; diff --git a/lib/rest-api.php b/lib/rest-api.php index 424927acf1f4a0..783abc24d3ee38 100644 --- a/lib/rest-api.php +++ b/lib/rest-api.php @@ -26,7 +26,7 @@ function gutenberg_override_global_styles_endpoint( array $args ): array { return $args; } -add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint', 10, 2 ); +add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint' ); /** * Registers the Edit Site Export REST API routes. diff --git a/tools/phpstan/baseline/level-0.php b/tools/phpstan/baseline/level-0.php index 71a6c918451e3b..7cf7bba9030a36 100644 --- a/tools/phpstan/baseline/level-0.php +++ b/tools/phpstan/baseline/level-0.php @@ -1,65 +1,17 @@ '#^Callback expects 1 parameter, \\$accepted_args is set to 2\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/block-supports/block-style-variations.php', -]; $ignoreErrors[] = [ // identifier: return.missing 'message' => '#^Function gutenberg_tinycolor_string_to_rgb\\(\\) should return array but return statement is missing\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/block-supports/duotone.php', ]; -$ignoreErrors[] = [ - // identifier: return.missing - 'message' => '#^Method WP_Duotone_Gutenberg\\:\\:get_selector\\(\\) should return string but return statement is missing\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: return.missing - 'message' => '#^Method WP_Theme_JSON_Gutenberg\\:\\:should_override_preset\\(\\) should return bool but return statement is missing\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^One or more @param tags has an invalid name or invalid syntax\\.$#', - 'count' => 4, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', -]; $ignoreErrors[] = [ // identifier: class.notFound 'message' => '#^Call to static method get_stores\\(\\) on an unknown class WP_Style_Engine_CSS_Rules_Store_Gutenberg\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/client-assets.php', ]; -$ignoreErrors[] = [ - // identifier: new.static - 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', -]; -$ignoreErrors[] = [ - // identifier: return.missing - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_7\\:\\:get_wp_templates_author_text_field\\(\\) should return string but return statement is missing\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', -]; -$ignoreErrors[] = [ - // identifier: arguments.count - 'message' => '#^Callback expects 1 parameter, \\$accepted_args is set to 2\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/kses-allowed-html.php', -]; -$ignoreErrors[] = [ - // identifier: arguments.count - 'message' => '#^Callback expects 1 parameter, \\$accepted_args is set to 2\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/rest-api.php', -]; return ['parameters' => ['ignoreErrors' => $ignoreErrors]]; diff --git a/tools/phpstan/baseline/level-1.php b/tools/phpstan/baseline/level-1.php index dd401074da9444..2ad1e5aea506b7 100644 --- a/tools/phpstan/baseline/level-1.php +++ b/tools/phpstan/baseline/level-1.php @@ -1,48 +1,12 @@ '#^Function remove_filter invoked with 4 parameters, 2\\-3 required\\.$#', - 'count' => 4, - 'path' => __DIR__ . '/../../../lib/block-supports/elements.php', -]; -$ignoreErrors[] = [ - // identifier: arguments.count - 'message' => '#^Function remove_filter invoked with 4 parameters, 2\\-3 required\\.$#', - 'count' => 3, - 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', -]; -$ignoreErrors[] = [ - // identifier: arguments.count - 'message' => '#^Function remove_filter invoked with 4 parameters, 2\\-3 required\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/block-supports/settings.php', -]; $ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$filter_id might not be defined\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', ]; -$ignoreErrors[] = [ - // identifier: isset.variable - 'message' => '#^Variable \\$area in isset\\(\\) always exists and is not nullable\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-template-utils.php', -]; -$ignoreErrors[] = [ - // identifier: arguments.count - 'message' => '#^Class WP_Webfonts constructor invoked with 1 parameter, 0 required\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/font-face/bc-layer/webfonts-deprecations.php', -]; -$ignoreErrors[] = [ - // identifier: arguments.count - 'message' => '#^Function gutenberg_url invoked with 2 parameters, 1 required\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/posts/load.php', -]; $ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$cache_key might not be defined\\.$#', diff --git a/tools/phpstan/baseline/level-2.php b/tools/phpstan/baseline/level-2.php index 3ff6a0742837e2..b2ea164243ec6e 100644 --- a/tools/phpstan/baseline/level-2.php +++ b/tools/phpstan/baseline/level-2.php @@ -1,24 +1,12 @@ '#^Binary operation "/" between string and 255 results in an error\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/block-supports/duotone.php', -]; $ignoreErrors[] = [ // identifier: method.void 'message' => '#^Result of method WP_HTML_Tag_Processor\\:\\:class_list\\(\\) \\(void\\) is used\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', ]; -$ignoreErrors[] = [ - // identifier: binaryOp.invalid - 'message' => '#^Binary operation "/" between string and 255 results in an error\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', -]; $ignoreErrors[] = [ // identifier: staticClassAccess.privateMethod 'message' => '#^Unsafe call to private method WP_Theme_JSON_Gutenberg\\:\\:compute_spacing_sizes\\(\\) through static\\:\\:\\.$#', @@ -61,30 +49,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', ]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^PHPDoc tag @param has invalid value \\(WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data\\.\\)\\: Unexpected token "Class", expected variable at offset 148$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^PHPDoc tag @param has invalid value \\(WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data\\.\\)\\: Unexpected token "Class", expected variable at offset 154$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^PHPDoc tag @param has invalid value \\(WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data\\.\\)\\: Unexpected token "Class", expected variable at offset 155$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^PHPDoc tag @param has invalid value \\(WP_Theme_JSON_Data_Gutenberg Class to access and update the underlying data\\.\\)\\: Unexpected token "Class", expected variable at offset 156$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', -]; $ignoreErrors[] = [ // identifier: staticClassAccess.privateMethod 'message' => '#^Unsafe call to private method WP_Theme_JSON_Resolver_Gutenberg\\:\\:inject_variations_from_block_style_variation_files\\(\\) through static\\:\\:\\.$#', @@ -115,24 +79,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; -$ignoreErrors[] = [ - // identifier: parameter.notFound - 'message' => '#^PHPDoc tag @param references unknown parameter\\: \\$source_args$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-bindings/pattern-overrides.php', -]; -$ignoreErrors[] = [ - // identifier: parameter.notFound - 'message' => '#^PHPDoc tag @param references unknown parameter\\: \\$settings$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/block-bindings.php', -]; -$ignoreErrors[] = [ - // identifier: property.notFound - 'message' => '#^Access to an undefined property WP_Block_Template\\:\\:\\$plugin\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', -]; $ignoreErrors[] = [ // identifier: property.notFound 'message' => '#^Access to an undefined property WP_Token_Map\\:\\:\\$groups\\.$#', @@ -164,46 +110,16 @@ 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php', ]; $ignoreErrors[] = [ - // identifier: property.notFound - 'message' => '#^Access to an undefined property WP_Block_Template\\:\\:\\$plugin\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', -]; -$ignoreErrors[] = [ - // identifier: property.notFound - 'message' => '#^Access to an undefined property WP_Block_Template\\:\\:\\$plugin\\.$#', - 'count' => 5, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', -]; -$ignoreErrors[] = [ - // identifier: property.notFound - 'message' => '#^Access to an undefined property object\\:\\:\\$slug\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', -]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^PHPDoc tag @param has invalid value \\(\\[WP_Block_Template\\|null\\] \\$block_template The found block template, or null if there isn’t one\\.\\)\\: Unexpected token "\\|", expected \'\\]\' at offset 115$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', -]; -$ignoreErrors[] = [ - // identifier: phpDoc.parseError - 'message' => '#^PHPDoc tag @return has invalid value \\(\\[WP_Block_Template\\|null\\] The block template that was already found with the plugin property defined if it was registered by a plugin\\.\\)\\: Unexpected token "\\|", expected \'\\]\' at offset 223$#', + // identifier: method.notFound + 'message' => '#^Call to an undefined method object\\:\\:set\\(\\)\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ // identifier: property.notFound - 'message' => '#^Access to an undefined property WP_Block_Template\\:\\:\\$plugin\\.$#', + 'message' => '#^Access to an undefined property object\\:\\:\\$ID\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/rest-api.php', -]; -$ignoreErrors[] = [ - // identifier: method.notFound - 'message' => '#^Call to an undefined method object\\:\\:set\\(\\)\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ // identifier: property.notFound diff --git a/tools/phpstan/baseline/level-3.php b/tools/phpstan/baseline/level-3.php index 6bb509f3d6e2fb..2f08875a49f680 100644 --- a/tools/phpstan/baseline/level-3.php +++ b/tools/phpstan/baseline/level-3.php @@ -7,24 +7,12 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', ]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function gutenberg_get_typography_value_and_unit\\(\\) should return array but returns null\\.$#', - 'count' => 3, - 'path' => __DIR__ . '/../../../lib/block-supports/typography.php', -]; $ignoreErrors[] = [ // identifier: return.empty 'message' => '#^Function _gutenberg_footnotes_force_filtered_html_on_import_filter\\(\\) should return string but empty return statement found\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/blocks.php', ]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Method WP_Duotone_Gutenberg\\:\\:get_selector\\(\\) should return string but returns null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', -]; $ignoreErrors[] = [ // identifier: method.childParameterType 'message' => '#^Parameter \\#1 \\$id \\(int\\) of method WP_REST_Global_Styles_Controller_Gutenberg\\:\\:prepare_links\\(\\) should be compatible with parameter \\$post \\(WP_Post\\) of method WP_REST_Posts_Controller\\:\\:prepare_links\\(\\)$#', @@ -44,70 +32,76 @@ 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: assign.propertyType - 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$blocks \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', + // identifier: return.type + 'message' => '#^Method WP_Theme_JSON_Resolver_Gutenberg\\:\\:get_block_data\\(\\) should return WP_Theme_JSON_Gutenberg but returns WP_Theme_JSON\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: assign.propertyType - 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$core \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', + // identifier: return.type + 'message' => '#^Method WP_Theme_JSON_Resolver_Gutenberg\\:\\:get_core_data\\(\\) should return WP_Theme_JSON_Gutenberg but returns WP_Theme_JSON\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', +]; +$ignoreErrors[] = [ + // identifier: return.type + 'message' => '#^Method WP_Theme_JSON_Resolver_Gutenberg\\:\\:get_user_data\\(\\) should return WP_Theme_JSON_Gutenberg but returns WP_Theme_JSON\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ // identifier: assign.propertyType - 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$i18n_schema \\(array\\) does not accept null\\.$#', + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$blocks \\(WP_Theme_JSON_Gutenberg\\) does not accept WP_Theme_JSON\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ // identifier: assign.propertyType - 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$theme \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$blocks \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ // identifier: assign.propertyType - 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$user \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$core \\(WP_Theme_JSON_Gutenberg\\) does not accept WP_Theme_JSON\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ // identifier: assign.propertyType - 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$user_custom_post_type_id \\(int\\) does not accept null\\.$#', + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$core \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function _gutenberg_get_block_templates_files\\(\\) should return array but returns null\\.$#', + // identifier: assign.propertyType + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$i18n_schema \\(array\\) does not accept null\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-template-utils.php', + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function gutenberg_replace_pattern_override_default_binding\\(\\) should return string but returns array\\.$#', + // identifier: assign.propertyType + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$theme \\(WP_Theme_JSON_Gutenberg\\) does not accept WP_Theme_JSON\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/blocks.php', + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Method Gutenberg_Token_Map_6_6\\:\\:from_array\\(\\) should return WP_Token_Map\\|null but returns static\\(Gutenberg_Token_Map_6_6\\)\\.$#', + // identifier: assign.propertyType + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$theme \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Method Gutenberg_Token_Map_6_6\\:\\:from_precomputed_table\\(\\) should return WP_Token_Map but returns null\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', + // identifier: assign.propertyType + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$user \\(WP_Theme_JSON_Gutenberg\\) does not accept null\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Method Gutenberg_Token_Map_6_6\\:\\:from_precomputed_table\\(\\) should return WP_Token_Map but returns static\\(Gutenberg_Token_Map_6_6\\)\\.$#', + // identifier: assign.propertyType + 'message' => '#^Static property WP_Theme_JSON_Resolver_Gutenberg\\:\\:\\$user_custom_post_type_id \\(int\\) does not accept null\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ // identifier: offsetAssign.dimType @@ -127,11 +121,4 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/experimental/media/class-gutenberg-rest-attachments-controller.php', ]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function gutenberg_register_block_module_id\\(\\) should return string but returns false\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/experimental/script-modules.php', -]; - return ['parameters' => ['ignoreErrors' => $ignoreErrors]]; diff --git a/tools/phpstan/baseline/level-4.php b/tools/phpstan/baseline/level-4.php index 98156dbcbf991e..7bc045b8d22ba2 100644 --- a/tools/phpstan/baseline/level-4.php +++ b/tools/phpstan/baseline/level-4.php @@ -7,24 +7,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../gutenberg.php', ]; -$ignoreErrors[] = [ - // identifier: nullCoalesce.offset - 'message' => '#^Offset 1 on array\\{array\\, array\\\\} on left side of \\?\\? always exists and is not nullable\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/block-supports/block-style-variations.php', -]; -$ignoreErrors[] = [ - // identifier: booleanAnd.alwaysFalse - 'message' => '#^Result of && is always false\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/block-supports/duotone.php', -]; -$ignoreErrors[] = [ - // identifier: identical.alwaysFalse - 'message' => '#^Strict comparison using \\=\\=\\= between 1 and float will always evaluate to false\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/block-supports/duotone.php', -]; $ignoreErrors[] = [ // identifier: booleanOr.alwaysTrue 'message' => '#^Result of \\|\\| is always true\\.$#', @@ -32,46 +14,22 @@ 'path' => __DIR__ . '/../../../lib/block-supports/position.php', ]; $ignoreErrors[] = [ - // identifier: booleanAnd.leftAlwaysTrue - 'message' => '#^Left side of && is always true\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/block-supports/shadow.php', -]; -$ignoreErrors[] = [ - // identifier: booleanNot.alwaysFalse - 'message' => '#^Negated boolean expression is always false\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: smallerOrEqual.alwaysTrue - 'message' => '#^Comparison operation "\\<\\=" between 0 and int\\<0, max\\>\\|false is always true\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: if.alwaysFalse - 'message' => '#^If condition is always false\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: booleanAnd.leftAlwaysTrue - 'message' => '#^Left side of && is always true\\.$#', + // identifier: booleanNot.alwaysTrue + 'message' => '#^Negated boolean expression is always true\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-template-utils.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', ]; $ignoreErrors[] = [ - // identifier: nullCoalesce.property - 'message' => '#^Property WP_Post_Type\\:\\:\\$template \\(array\\\\) on left side of \\?\\? is not nullable\\.$#', + // identifier: empty.offset + 'message' => '#^Offset \'rendered\' on array\\{raw\\: mixed\\} in empty\\(\\) does not exist\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/blocks.php', ]; $ignoreErrors[] = [ - // identifier: booleanNot.alwaysTrue - 'message' => '#^Negated boolean expression is always true\\.$#', + // identifier: deadCode.unreachable + 'message' => '#^Unreachable statement \\- code above always terminates\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/blocks.php', ]; $ignoreErrors[] = [ // identifier: return.unusedType @@ -79,12 +37,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/experimental/navigation-theme-opt-in.php', ]; -$ignoreErrors[] = [ - // identifier: if.alwaysFalse - 'message' => '#^If condition is always false\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/navigation-theme-opt-in.php', -]; $ignoreErrors[] = [ // identifier: if.alwaysTrue 'message' => '#^If condition is always true\\.$#', diff --git a/tools/phpstan/baseline/level-5.php b/tools/phpstan/baseline/level-5.php index da16d8ccd17106..0f566cc4068be9 100644 --- a/tools/phpstan/baseline/level-5.php +++ b/tools/phpstan/baseline/level-5.php @@ -1,24 +1,12 @@ '#^Parameter \\#1 \\$separator of function explode expects string, float given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#2 \\$args of function register_block_type expects array\\{api_version\\?\\: string, title\\?\\: string, category\\?\\: string\\|null, parent\\?\\: array\\\\|null, ancestor\\?\\: array\\\\|null, allowed_blocks\\?\\: array\\\\|null, icon\\?\\: string\\|null, description\\?\\: string, \\.\\.\\.\\}, array\\{category\\: \'widgets\', attributes\\: array\\{url\\: array\\{type\\: \'string\'\\}, service\\: array\\{type\\: \'string\', default\\: \'amazon\'\\|\'bandcamp\'\\|\'behance\'\\|\'chain\'\\|\'codepen\'\\|\'deviantart\'\\|\'dribbble\'\\|\'dropbox\'\\|\'etsy\'\\|\'facebook\'\\|\'feed\'\\|\'fivehundredpx\'\\|\'flickr\'\\|\'foursquare\'\\|\'github\'\\|\'goodreads\'\\|\'google\'\\|\'instagram\'\\|\'lastfm\'\\|\'linkedin\'\\|\'mail\'\\|\'mastodon\'\\|\'medium\'\\|\'meetup\'\\|\'pinterest\'\\|\'pocket\'\\|\'reddit\'\\|\'skype\'\\|\'snapchat\'\\|\'soundcloud\'\\|\'spotify\'\\|\'tumblr\'\\|\'twitch\'\\|\'twitter\'\\|\'vimeo\'\\|\'vk\'\\|\'wordpress\'\\|\'yelp\'\\|\'youtube\'\\}, label\\: array\\{type\\: \'string\'\\}\\}, render_callback\\: \'gutenberg_render…\'\\} given\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/blocks.php', ]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$value of static method WP_Duotone_Gutenberg\\:\\:colord_parse_hue\\(\\) expects float, string given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#1 \\$incoming of method WP_Theme_JSON\\:\\:merge\\(\\) expects WP_Theme_JSON, WP_Theme_JSON_Gutenberg given\\.$#', @@ -33,28 +21,10 @@ ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$metadata of method WP_Theme_JSON_Gutenberg\\:\\:get_feature_declarations_for_node\\(\\) expects object, array given\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$function_name of function _doing_it_wrong expects string, true given\\.$#', + 'message' => '#^Parameter \\#1 \\$incoming of method WP_Theme_JSON_Gutenberg\\:\\:merge\\(\\) expects WP_Theme_JSON_Gutenberg, WP_Theme_JSON given\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#5 \\$media of function wp_register_style expects string, true given\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/client-assets.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$str of function strtoupper expects string, bool given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#2 \\$value of method WP_HTTP_Response\\:\\:header\\(\\) expects string, int given\\.$#', @@ -67,18 +37,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', ]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$str of function strtoupper expects string, bool given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$value of function setcookie expects string, int given\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/experimental/sync/class-gutenberg-http-signaling-server.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#5 \\$callback of function add_menu_page expects callable\\(\\)\\: mixed, \'\' given\\.$#', diff --git a/tools/phpstan/baseline/level-6.php b/tools/phpstan/baseline/level-6.php index a81fe413982bfb..920c1344f8f53d 100644 --- a/tools/phpstan/baseline/level-6.php +++ b/tools/phpstan/baseline/level-6.php @@ -351,291 +351,291 @@ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_admin_bar_edit_site_menu\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_bootstrap_server_block_bindings_sources\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/admin-bar.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/block-bindings.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function gutenberg_block_bindings_pattern_overrides_callback\\(\\) has parameter \\$source_attrs with no type specified\\.$#', + // identifier: missingType.generics + 'message' => '#^Method Gutenberg_REST_Posts_Controller_6_7\\:\\:get_items\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-bindings/pattern-overrides.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_register_block_bindings_pattern_overrides_source\\(\\) has no return type specified\\.$#', + // identifier: missingType.generics + 'message' => '#^Method Gutenberg_REST_Posts_Controller_6_7\\:\\:prepare_tax_query\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-bindings/pattern-overrides.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php', ]; $ignoreErrors[] = [ // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Global_Styles_Revisions_Controller_6_6\\:\\:prepare_item_for_response\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_7\\:\\:get_item\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-global-styles-revisions-controller-6-6.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', ]; $ignoreErrors[] = [ // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_6\\:\\:get_item_permissions_check\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_7\\:\\:prepare_item_for_response\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_6\\:\\:get_items\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.return + 'message' => '#^Method WP_Block_Templates_Registry\\:\\:get_by_query\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_6\\:\\:get_items_permissions_check\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.property + 'message' => '#^Property WP_Block_Templates_Registry\\:\\:\\$registered_templates has no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_6\\:\\:get_template_fallback\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.return + 'message' => '#^Function gutenberg_post_format_rest_posts_controller\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/post-formats.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_6\\:\\:prepare_item_for_response\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.parameter + 'message' => '#^Function gutenberg_post_format_rest_posts_controller\\(\\) has parameter \\$args with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/post-formats.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_change_patterns_link_and_remove_template_parts_submenu_item\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_register_wp_rest_templates_controller_plugin_field\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/compat.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/rest-api.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_update_initial_settings\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_a11y_script_module_html\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/option.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/script-modules.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function gutenberg_update_initial_settings\\(\\) has parameter \\$args with no type specified\\.$#', + // identifier: missingType.return + 'message' => '#^Function exclude_block_comments_from_admin\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/option.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ // identifier: missingType.parameter - 'message' => '#^Function gutenberg_update_initial_settings\\(\\) has parameter \\$defaults with no type specified\\.$#', + 'message' => '#^Function exclude_block_comments_from_admin\\(\\) has parameter \\$query with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/option.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function gutenberg_update_initial_settings\\(\\) has parameter \\$option_group with no type specified\\.$#', + // identifier: missingType.return + 'message' => '#^Function update_comment_type_in_rest_api_6_8\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/option.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ // identifier: missingType.parameter - 'message' => '#^Function gutenberg_update_initial_settings\\(\\) has parameter \\$option_name with no type specified\\.$#', + 'message' => '#^Function update_comment_type_in_rest_api_6_8\\(\\) has parameter \\$prepared_comment with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/option.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_add_excerpt_support_to_wp_block\\(\\) has no return type specified\\.$#', + // identifier: missingType.parameter + 'message' => '#^Function update_comment_type_in_rest_api_6_8\\(\\) has parameter \\$request with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/post.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_replace_pattern_blocks_patterns_endpoint\\(\\) has no return type specified\\.$#', + 'message' => '#^Function update_get_avatar_comment_type\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/resolve-patterns.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ // identifier: missingType.parameter - 'message' => '#^Function gutenberg_replace_pattern_blocks_patterns_endpoint\\(\\) has parameter \\$request with no type specified\\.$#', + 'message' => '#^Function update_get_avatar_comment_type\\(\\) has parameter \\$comment_type with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/resolve-patterns.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function gutenberg_replace_pattern_blocks_patterns_endpoint\\(\\) has parameter \\$result with no type specified\\.$#', + // identifier: missingType.return + 'message' => '#^Function gutenberg_apply_block_hooks_to_post_content\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/resolve-patterns.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/blocks.php', ]; $ignoreErrors[] = [ // identifier: missingType.parameter - 'message' => '#^Function gutenberg_replace_pattern_blocks_patterns_endpoint\\(\\) has parameter \\$server with no type specified\\.$#', + 'message' => '#^Function gutenberg_apply_block_hooks_to_post_content\\(\\) has parameter \\$content with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/resolve-patterns.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/blocks.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_add_class_list_to_public_post_types\\(\\) has no return type specified\\.$#', + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:add_hierarchical_ids\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_register_global_styles_revisions_endpoints\\(\\) has no return type specified\\.$#', + // identifier: missingType.parameter + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:add_hierarchical_ids\\(\\) has parameter \\$children with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_register_wp_rest_post_types_controller_fields\\(\\) has no return type specified\\.$#', + // identifier: missingType.parameter + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:add_hierarchical_ids\\(\\) has parameter \\$ids with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_register_wp_rest_themes_stylesheet_directory_uri_field\\(\\) has no return type specified\\.$#', + // identifier: missingType.parameter + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:add_hierarchical_ids\\(\\) has parameter \\$level with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_register_wp_rest_themes_template_directory_uri_field\\(\\) has no return type specified\\.$#', + // identifier: missingType.parameter + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:add_hierarchical_ids\\(\\) has parameter \\$levels with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ // identifier: missingType.parameter - 'message' => '#^Function gutenberg_add_can_update_block_bindings_editor_setting\\(\\) has parameter \\$editor_settings with no type specified\\.$#', + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:add_hierarchical_ids\\(\\) has parameter \\$to_process with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/block-bindings.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_bootstrap_server_block_bindings_sources\\(\\) has no return type specified\\.$#', + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:get_ancestor\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/block-bindings.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Posts_Controller_6_7\\:\\:get_items\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.parameter + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:get_ancestor\\(\\) has parameter \\$post_id with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Posts_Controller_6_7\\:\\:prepare_tax_query\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.return + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:get_instance\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_7\\:\\:get_item\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.return + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:get_levels\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Templates_Controller_6_7\\:\\:prepare_item_for_response\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.return + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:get_post_ids\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Method WP_Block_Templates_Registry\\:\\:get_by_query\\(\\) has no return type specified\\.$#', + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:run\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', +]; +$ignoreErrors[] = [ + // identifier: missingType.parameter + 'message' => '#^Method Gutenberg_Hierarchical_Sort\\:\\:run\\(\\) has parameter \\$args with no type specified\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ // identifier: missingType.property - 'message' => '#^Property WP_Block_Templates_Registry\\:\\:\\$registered_templates has no type specified\\.$#', + 'message' => '#^Property Gutenberg_Hierarchical_Sort\\:\\:\\$instance has no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function _gutenberg_add_block_template_plugin_attribute\\(\\) has no return type specified\\.$#', + // identifier: missingType.property + 'message' => '#^Property Gutenberg_Hierarchical_Sort\\:\\:\\$levels has no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function _gutenberg_add_block_template_plugin_attribute\\(\\) has parameter \\$block_template with no type specified\\.$#', + // identifier: missingType.property + 'message' => '#^Property Gutenberg_Hierarchical_Sort\\:\\:\\$post_ids has no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-hierarchical-sort.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_post_format_rest_posts_controller\\(\\) has no return type specified\\.$#', + // identifier: missingType.generics + 'message' => '#^Method Gutenberg_REST_Comment_Controller_6_8\\:\\:create_item_permissions_check\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/post-formats.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-rest-comment-controller-6-8.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function gutenberg_post_format_rest_posts_controller\\(\\) has parameter \\$args with no type specified\\.$#', + // identifier: missingType.generics + 'message' => '#^Method Gutenberg_REST_Post_Types_Controller_6_8\\:\\:prepare_item_for_response\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/post-formats.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-rest-post-types-controller-6-8.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_register_wp_rest_templates_controller_plugin_field\\(\\) has no return type specified\\.$#', + // identifier: missingType.generics + 'message' => '#^Function gutenberg_modify_user_query_args\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/rest-api.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-rest-user-controller.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function gutenberg_a11y_script_module_html\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_add_post_type_rendering_mode\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/script-modules.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/rest-api.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function exclude_block_comments_from_admin\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_respect_taxonomy_default_args_in_rest_api\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/rest-api.php', ]; $ignoreErrors[] = [ // identifier: missingType.parameter - 'message' => '#^Function exclude_block_comments_from_admin\\(\\) has parameter \\$query with no type specified\\.$#', + 'message' => '#^Function gutenberg_respect_taxonomy_default_args_in_rest_api\\(\\) has parameter \\$args with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/rest-api.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function update_comment_type_in_rest_api_6_8\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_add_styles_submenu_item\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/site-editor.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function update_comment_type_in_rest_api_6_8\\(\\) has parameter \\$prepared_comment with no type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', -]; -$ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function update_comment_type_in_rest_api_6_8\\(\\) has parameter \\$request with no type specified\\.$#', + // identifier: missingType.return + 'message' => '#^Function gutenberg_get_site_editor_redirection\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/site-editor.php', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function update_get_avatar_comment_type\\(\\) has no return type specified\\.$#', + 'message' => '#^Function gutenberg_redirect_site_editor_deprecated_urls\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/site-editor.php', ]; $ignoreErrors[] = [ - // identifier: missingType.parameter - 'message' => '#^Function update_get_avatar_comment_type\\(\\) has parameter \\$comment_type with no type specified\\.$#', + // identifier: missingType.return + 'message' => '#^Function gutenberg_redirect_demo\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/block-comments.php', + 'path' => __DIR__ . '/../../../lib/demo.php', ]; $ignoreErrors[] = [ - // identifier: missingType.generics - 'message' => '#^Method Gutenberg_REST_Comment_Controller_6_8\\:\\:create_item_permissions_check\\(\\) has parameter \\$request with generic class WP_REST_Request but does not specify its types\\: T$#', + // identifier: missingType.return + 'message' => '#^Function gutenberg_block_core_form_view_script_module\\(\\) has no return type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/class-gutenberg-rest-comment-controller-6-8.php', + 'path' => __DIR__ . '/../../../lib/experimental/blocks.php', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_redirect_demo\\(\\) has no return type specified\\.$#', + // identifier: missingType.parameter + 'message' => '#^Function gutenberg_block_core_form_view_script_module\\(\\) has parameter \\$data with no type specified\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/demo.php', + 'path' => __DIR__ . '/../../../lib/experimental/blocks.php', ]; $ignoreErrors[] = [ // identifier: missingType.return @@ -901,12 +901,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/experimental/navigation-theme-opt-in.php', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function gutenberg_add_post_type_arg\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/posts/load.php', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function gutenberg_posts_dashboard\\(\\) has no return type specified\\.$#', diff --git a/tools/phpstan/baseline/level-7.php b/tools/phpstan/baseline/level-7.php index a695d67691c5b0..cefa5be2941879 100644 --- a/tools/phpstan/baseline/level-7.php +++ b/tools/phpstan/baseline/level-7.php @@ -19,6 +19,24 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/block-supports/elements.php', ]; +$ignoreErrors[] = [ + // identifier: offsetAccess.notFound + 'message' => '#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-falsy\\-string, 2\\?\\: non\\-falsy\\-string, 3\\?\\: non\\-falsy\\-string\\}\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', +]; +$ignoreErrors[] = [ + // identifier: offsetAccess.notFound + 'message' => '#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-falsy\\-string, 2\\?\\: non\\-falsy\\-string, 3\\?\\: non\\-falsy\\-string\\}\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', +]; +$ignoreErrors[] = [ + // identifier: offsetAccess.notFound + 'message' => '#^Offset 3 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-falsy\\-string, 2\\?\\: non\\-falsy\\-string, 3\\?\\: non\\-falsy\\-string\\}\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/block-supports/layout.php', +]; $ignoreErrors[] = [ // identifier: encapsedStringPart.nonString 'message' => '#^Part \\$process_value \\(array\\\\|string\\) of encapsed string cannot be cast to string\\.$#', @@ -109,12 +127,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', ]; -$ignoreErrors[] = [ - // identifier: offsetAccess.nonOffsetAccessible - 'message' => '#^Cannot access offset \'selectors\' on object\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', -]; $ignoreErrors[] = [ // identifier: offsetAccess.nonOffsetAccessible 'message' => '#^Cannot access offset mixed on object\\.$#', @@ -133,12 +145,24 @@ 'count' => 2, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', ]; +$ignoreErrors[] = [ + // identifier: return.type + 'message' => '#^Method WP_Theme_JSON_Resolver_Gutenberg\\:\\:get_theme_data\\(\\) should return WP_Theme_JSON_Gutenberg but returns WP_Theme_JSON\\|WP_Theme_JSON_Gutenberg\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', +]; $ignoreErrors[] = [ // identifier: return.type 'message' => '#^Method WP_Theme_JSON_Resolver_Gutenberg\\:\\:translate\\(\\) should return array but returns array\\\\|string\\.$#', 'count' => 1, 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; +$ignoreErrors[] = [ + // identifier: argument.type + 'message' => '#^Parameter \\#1 \\$incoming of method WP_Theme_JSON_Gutenberg\\:\\:merge\\(\\) expects WP_Theme_JSON_Gutenberg, WP_Theme_JSON\\|WP_Theme_JSON_Gutenberg given\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', +]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#1 \\$obj of function get_object_vars expects object, int\\|WP_Post given\\.$#', @@ -181,48 +205,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/client-assets.php', ]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$post of function _build_block_template_result_from_post expects WP_Post, int\\|WP_Post given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-template-utils.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$template_type of function _build_block_template_result_from_file expects \'wp_template\'\\|\'wp_template_part\', string given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/block-template-utils.php', -]; -$ignoreErrors[] = [ - // identifier: property.notFound - 'message' => '#^Access to an undefined property WP_Error\\|WP_Post\\:\\:\\$ID\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-global-styles-revisions-controller-6-6.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$theme_json of static method WP_Theme_JSON_Resolver_Gutenberg\\:\\:get_resolved_theme_uris\\(\\) expects WP_Theme_JSON_Gutenberg, array\\|WP_Theme_JSON_Gutenberg given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-rest-global-styles-revisions-controller-6-6.php', -]; -$ignoreErrors[] = [ - // identifier: offsetAccess.nonOffsetAccessible - 'message' => '#^Cannot access offset 1 on array\\|false\\.$#', - 'count' => 8, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$callback of function usort expects callable\\(int\\|string, int\\|string\\)\\: int, \'static\\:\\:longest…\' given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/class-gutenberg-token-map-6-6.php', -]; -$ignoreErrors[] = [ - // identifier: property.notFound - 'message' => '#^Access to an undefined property object\\:\\:\\$item_updated\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.6/post.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#2 \\$args of method WP_Block_Templates_Registry\\:\\:register\\(\\) expects array, array\\|string given\\.$#', @@ -307,6 +289,12 @@ 'count' => 1, 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php', ]; +$ignoreErrors[] = [ + // identifier: argument.type + 'message' => '#^Parameter \\#1 \\$template_type of function _get_block_templates_files expects \'wp_template\'\\|\'wp_template_part\', string given\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', +]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#1 \\$data of function wp_print_inline_script_tag expects string, string\\|false given\\.$#', diff --git a/tools/phpstan/baseline/level-8.php b/tools/phpstan/baseline/level-8.php index e035a4ff159bcb..dda2890ed0ab52 100644 --- a/tools/phpstan/baseline/level-8.php +++ b/tools/phpstan/baseline/level-8.php @@ -75,15 +75,15 @@ ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$content of method ZipArchive\\:\\:addFromString\\(\\) expects string, string\\|null given\\.$#', + 'message' => '#^Parameter \\#2 \\$pieces of function implode expects array, array\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/block-template-utils.php', + 'path' => __DIR__ . '/../../../lib/block-supports/typography.php', ]; $ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Method WP_Duotone_Gutenberg\\:\\:get_selector\\(\\) should return string but returns string\\|null\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/class-wp-duotone-gutenberg.php', + // identifier: argument.type + 'message' => '#^Parameter \\#2 \\$content of method ZipArchive\\:\\:addFromString\\(\\) expects string, string\\|null given\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/../../../lib/block-template-utils.php', ]; $ignoreErrors[] = [ // identifier: argument.type @@ -135,207 +135,81 @@ ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$obj of function get_object_vars expects object, WP_Post\\|null given\\.$#', + 'message' => '#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, string\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-gutenberg.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$subject of function preg_match_all expects string, string\\|null given\\.$#', + 'message' => '#^Parameter \\#1 \\$obj of function get_object_vars expects object, WP_Post\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/l10n.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, string\\|null given\\.$#', - 'count' => 8, - 'path' => __DIR__ . '/../../../lib/experimental/l10n.php', + 'path' => __DIR__ . '/../../../lib/class-wp-theme-json-resolver-gutenberg.php', ]; $ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$item of method Gutenberg_REST_Attachments_Controller\\:\\:prepare_item_for_response\\(\\) expects WP_Post, WP_Post\\|null given\\.$#', + // identifier: parameter.phpDocType + 'message' => '#^@param WP_Post_Type \\$post_type does not accept actual type of parameter\\: WP_Post_Type\\|null\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/media/class-gutenberg-rest-attachments-controller.php', -]; -$ignoreErrors[] = [ - // identifier: property.nonObject - 'message' => '#^Cannot access property \\$labels on WP_Post_Type\\|null\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../lib/experimental/posts/load.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php', ]; $ignoreErrors[] = [ // identifier: property.nonObject 'message' => '#^Cannot access property \\$hierarchical on WP_Post_Type\\|null\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../lib/experimental/rest-api.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$url of function esc_url expects string, string\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/comment-edit-link/index.php', -]; -$ignoreErrors[] = [ - // identifier: property.nonObject - 'message' => '#^Cannot access property \\$comment_parent on WP_Comment\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/comment-reply-link/index.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$post of function setup_postdata expects int\\|object, WP_Post\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/comments/index.php', -]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function block_core_gallery_render\\(\\) should return string but returns string\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/gallery/index.php', -]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function block_core_image_render_lightbox\\(\\) should return string but returns string\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/image/index.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$value of method WP_HTML_Tag_Processor\\:\\:set_attribute\\(\\) expects bool\\|string, string\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/image/index.php', -]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function render_block_core_media_text\\(\\) should return string but returns string\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/media-text/index.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$html of class WP_HTML_Tag_Processor constructor expects string, string\\|null given\\.$#', + 'message' => '#^Parameter \\#2 \\$value of function get_user_by expects int\\|string, int\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/media-text/index.php', -]; -$ignoreErrors[] = [ - // identifier: property.nonObject - 'message' => '#^Cannot access property \\$name on WP_Post\\|WP_Post_Type\\|WP_Term\\|WP_User\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/navigation-link/index.php', -]; -$ignoreErrors[] = [ - // identifier: property.nonObject - 'message' => '#^Cannot access property \\$name on WP_Post\\|WP_Post_Type\\|WP_Term\\|WP_User\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/navigation-submenu/index.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$post of function block_core_navigation_set_ignored_hooked_blocks_metadata expects WP_Post, WP_Post\\|null given\\.$#', + 'message' => '#^Parameter \\#2 \\$haystack of function in_array expects array, array\\\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/navigation/index.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/class-wp-block-templates-registry.php', ]; $ignoreErrors[] = [ // identifier: foreach.nonIterable 'message' => '#^Argument of an invalid type array\\|null supplied for foreach, only iterables are supported\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/post-featured-image/index.php', -]; -$ignoreErrors[] = [ - // identifier: property.nonObject - 'message' => '#^Cannot access property \\$post_content on WP_Post\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/post-featured-image/index.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$value of method WP_HTML_Tag_Processor\\:\\:set_attribute\\(\\) expects bool\\|string, string\\|true\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/post-featured-image/index.php', -]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function render_block_core_query_pagination_next\\(\\) should return string but returns string\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/query-pagination-next/index.php', -]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Function render_block_core_query_pagination_previous\\(\\) should return string but returns string\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/query-pagination-previous/index.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.7/compat.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$callback of function remove_filter expects array\\|\\(callable\\(\\)\\: mixed\\)\\|string, \\(Closure\\(mixed, mixed\\)\\: mixed\\)\\|null given\\.$#', + 'message' => '#^Parameter \\#2 \\$context of function apply_block_hooks_to_content expects array\\|WP_Block_Template\\|WP_Post, WP_Post\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/query/index.php', -]; -$ignoreErrors[] = [ - // identifier: foreach.nonIterable - 'message' => '#^Argument of an invalid type array\\\\|null supplied for foreach, only iterables are supported\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/rss/index.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$str of function strip_tags expects string, string\\|null given\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/../../../packages/block-library/src/rss/index.php', + 'path' => __DIR__ . '/../../../lib/compat/wordpress-6.8/blocks.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$string of function html_entity_decode expects string, string\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/rss/index.php', -]; -$ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$url of function esc_url expects string, string\\|null given\\.$#', + 'message' => '#^Parameter \\#2 \\$subject of function preg_match_all expects string, string\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/rss/index.php', + 'path' => __DIR__ . '/../../../lib/experimental/l10n.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$str of function strtolower expects string, string\\|null given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/search/index.php', + 'message' => '#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, string\\|null given\\.$#', + 'count' => 8, + 'path' => __DIR__ . '/../../../lib/experimental/l10n.php', ]; $ignoreErrors[] = [ // identifier: argument.type - 'message' => '#^Parameter \\#1 \\$html of class WP_HTML_Tag_Processor constructor expects string, string\\|null given\\.$#', + 'message' => '#^Parameter \\#1 \\$item of method Gutenberg_REST_Attachments_Controller\\:\\:prepare_item_for_response\\(\\) expects WP_Post, WP_Post\\|null given\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/site-logo/index.php', + 'path' => __DIR__ . '/../../../lib/experimental/media/class-gutenberg-rest-attachments-controller.php', ]; $ignoreErrors[] = [ // identifier: property.nonObject - 'message' => '#^Cannot access property \\$content on WP_Block_Template\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/block-library/src/template-part/index.php', -]; -$ignoreErrors[] = [ - // identifier: method.nonObject - 'message' => '#^Cannot call method add_declarations\\(\\) on WP_Style_Engine_CSS_Rule\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/style-engine/class-wp-style-engine.php', -]; -$ignoreErrors[] = [ - // identifier: return.type - 'message' => '#^Method WP_Style_Engine\\:\\:get_store\\(\\) should return WP_Style_Engine_CSS_Rules_Store but returns WP_Style_Engine_CSS_Rules_Store\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/style-engine/class-wp-style-engine.php', -]; -$ignoreErrors[] = [ - // identifier: method.nonObject - 'message' => '#^Cannot call method render\\(\\) on WP_Block_Type\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../../packages/widgets/src/blocks/legacy-widget/index.php', + 'message' => '#^Cannot access property \\$labels on WP_Post_Type\\|null\\.$#', + 'count' => 2, + 'path' => __DIR__ . '/../../../lib/experimental/posts/load.php', ]; $ignoreErrors[] = [ - // identifier: argument.type - 'message' => '#^Parameter \\#2 \\$sidebar_id of function wp_render_widget expects string, string\\|null given\\.$#', + // identifier: property.nonObject + 'message' => '#^Cannot access property \\$hierarchical on WP_Post_Type\\|null\\.$#', 'count' => 1, - 'path' => __DIR__ . '/../../../packages/widgets/src/blocks/legacy-widget/index.php', + 'path' => __DIR__ . '/../../../lib/experimental/rest-api.php', ]; return ['parameters' => ['ignoreErrors' => $ignoreErrors]];