From 919859e4f469c3e41d3d819054a774eee6d0ab30 Mon Sep 17 00:00:00 2001 From: theodesp <328805+theodesp@users.noreply.github.com> Date: Tue, 2 Jan 2024 14:36:34 +0000 Subject: [PATCH] Code Review Compat Fixes --- includes/Blocks/Block.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/Blocks/Block.php b/includes/Blocks/Block.php index 8cf0e3c8..6fb7e112 100644 --- a/includes/Blocks/Block.php +++ b/includes/Blocks/Block.php @@ -128,8 +128,10 @@ private function register_block_attributes_as_fields(): void { * @param string $name The block name * @param object $attribute The block attribute config * @param string $prefix Current prefix string to use for the get_query_type + * + * @return mixed */ - private function get_attribute_type( $name, $attribute, $prefix ): mixed { + private function get_attribute_type( $name, $attribute, $prefix ) { $type = null; if ( isset( $attribute['type'] ) ) { @@ -183,8 +185,8 @@ private function get_attribute_type( $name, $attribute, $prefix ): mixed { /** * Gets the WPGraphQL field registration config for the block attributes. * - * @param ?array $block_attributes The block attributes. - * @param string $prefix The current prefix string to use for the get_query_type + * @param ?array $block_attributes The block attributes. + * @param string|null $prefix The current prefix string to use for the get_query_type * * @return array */ @@ -287,8 +289,10 @@ private function create_attributes_fields( $attributes, $prefix ): array { * * @param array|string $value The value * @param string $type The type of the value + * + * @return mixed */ - private function normalize_attribute_value( $value, $type ): mixed { + private function normalize_attribute_value( $value, $type ) { switch ( $type ) { case 'string': return (string) $value; @@ -433,8 +437,10 @@ private function resolve_block_attributes_recursive( $attributes, $html, $config * * @param string $html The html value * @param string $source The source type + * + * @return string|null */ - private function parse_single_source( $html, $source ): string|null { + private function parse_single_source( $html, $source ) { $value = null; if ( empty( $html ) ) { return $value;