From a9b749167b250773d386d0c99b28a2a4dca1c972 Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Mon, 25 Sep 2023 13:03:12 +0300 Subject: [PATCH] fix: phpstan issues --- inc/class-blocks-css.php | 2 +- inc/class-registration.php | 2 +- inc/css/class-block-frontend.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/class-blocks-css.php b/inc/class-blocks-css.php index c99a6421e..5602cd9df 100644 --- a/inc/class-blocks-css.php +++ b/inc/class-blocks-css.php @@ -123,7 +123,7 @@ function_exists( 'wp_is_block_theme' ) && $templates_parts = get_block_templates( array( 'slugs__in' => $slugs ), 'wp_template_part' ); foreach ( $templates_parts as $templates_part ) { - if ( isset( $templates_part->content ) && isset( $templates_part->slug ) && in_array( $templates_part->slug, $slugs ) ) { + if ( ! empty( $templates_part->content ) && ! empty( $templates_part->slug ) && in_array( $templates_part->slug, $slugs ) ) { $content .= $templates_part->content; } } diff --git a/inc/class-registration.php b/inc/class-registration.php index 0f04ac408..f345deafe 100644 --- a/inc/class-registration.php +++ b/inc/class-registration.php @@ -399,7 +399,7 @@ public function enqueue_dependencies( $post = null ) { $templates_parts = get_block_templates( array( 'slugs__in' => $slugs ), 'wp_template_part' ); foreach ( $templates_parts as $templates_part ) { - if ( isset( $templates_part->content ) && isset( $templates_part->slug ) && in_array( $templates_part->slug, $slugs ) ) { + if ( ! empty( $templates_part->content ) && ! empty( $templates_part->slug ) && in_array( $templates_part->slug, $slugs ) ) { $content .= $templates_part->content; } } diff --git a/inc/css/class-block-frontend.php b/inc/css/class-block-frontend.php index c6e8b6a7a..0ec65053c 100644 --- a/inc/css/class-block-frontend.php +++ b/inc/css/class-block-frontend.php @@ -596,7 +596,7 @@ public function enqueue_fse_css() { $templates_parts = get_block_templates( array( 'slugs__in' => $slugs ), 'wp_template_part' ); foreach ( $templates_parts as $templates_part ) { - if ( isset( $templates_part->content ) && isset( $templates_part->slug ) && in_array( $templates_part->slug, $slugs ) ) { + if ( ! empty( $templates_part->content ) && ! empty( $templates_part->slug ) && in_array( $templates_part->slug, $slugs ) ) { $content .= $templates_part->content; } }