diff --git a/src/wp-includes/block-supports/typography.php b/src/wp-includes/block-supports/typography.php index 6573119933721..9b4cf151b4a23 100644 --- a/src/wp-includes/block-supports/typography.php +++ b/src/wp-includes/block-supports/typography.php @@ -304,7 +304,7 @@ function wp_typography_get_preset_inline_style_value( $style_value, $css_propert * @return string Filtered block content. */ function wp_render_typography_support( $block_content, $block ) { - if ( ! empty( $block['attrs']['fitText'] ) && $block['attrs']['fitText'] && ! is_admin() ) { + if ( ! empty( $block['attrs']['fitText'] ) && ! is_admin() ) { wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' ); // Add Interactivity API directives for fit text to work with client-side navigation. diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index a7d5d4aa1141d..f77303f5917cd 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -460,7 +460,7 @@ function _get_block_templates_files( $template_type, $query = array() ) { if ( ! $post_type || - ( $post_type && isset( $candidate['postTypes'] ) && in_array( $post_type, $candidate['postTypes'], true ) ) + ( isset( $candidate['postTypes'] ) && in_array( $post_type, $candidate['postTypes'], true ) ) ) { $template_files[ $template_slug ] = $candidate; } diff --git a/src/wp-includes/class-wp-walker.php b/src/wp-includes/class-wp-walker.php index 7361520cbdccc..3937d5b89dff4 100644 --- a/src/wp-includes/class-wp-walker.php +++ b/src/wp-includes/class-wp-walker.php @@ -164,7 +164,7 @@ public function display_element( $element, &$children_elements, $max_depth, $dep unset( $children_elements[ $id ] ); } - if ( isset( $newlevel ) && $newlevel ) { + if ( isset( $newlevel ) ) { // End the child delimiter. $this->end_lvl( $output, $depth, ...array_values( $args ) ); } diff --git a/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon b/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon index c64a48177e085..69e4b48b16039 100644 --- a/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon +++ b/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon @@ -28,11 +28,6 @@ parameters: identifier: booleanAnd.leftAlwaysTrue count: 1 path: ../../../src/wp-admin/themes.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../src/wp-includes/block-template-utils.php - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue diff --git a/tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon b/tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon index 64071efcf3d23..a74e9d89d9fd2 100644 --- a/tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon +++ b/tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon @@ -33,16 +33,6 @@ parameters: identifier: booleanAnd.rightAlwaysTrue count: 1 path: ../../../src/wp-content/themes/twentynineteen/header.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../src/wp-includes/block-supports/typography.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../src/wp-includes/class-wp-walker.php - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue