' . esc_html__( 'No earlier versions of this comment are recorded.', 'internal-comments' ) . '
'; - return; } diff --git a/plugins/internal-comments/src/Comments.php b/plugins/internal-comments/src/Comments.php index ce862f1..ed42ebe 100644 --- a/plugins/internal-comments/src/Comments.php +++ b/plugins/internal-comments/src/Comments.php @@ -243,7 +243,6 @@ public function hide_unmoved_comments( \WP_Comment_Query $query ): void { */ public function hide_unmoved_feed_comments( string $where ): string { global $wpdb; - return dws_ic_is_v1_move_pending() ? $where . ( $wpdb->prepare( ' AND %i.comment_type <> %s', $wpdb->comments, DWS_IC_COMMENT_TYPE ) ?? '' ) : $where; } @@ -276,7 +275,6 @@ public function guard_privacy( mixed $check, int $comment_id, string $meta_key, } $comment = dws_ic_get_comment( $comment_id ); - return null !== $comment && get_current_user_id() !== (int) $comment->user_id ? false : $check; } @@ -307,7 +305,6 @@ protected function put_back( int|string $comment_id ): ?string { $wpdb->update( $wpdb->comments, array( 'comment_approved' => DWS_IC_COMMENT_STATUS ), array( 'comment_ID' => (int) $comment->comment_ID ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- wp_set_comment_status() refuses a status of its own, and the cache is cleaned below. clean_comment_cache( (int) $comment->comment_ID ); wp_update_comment_count( (int) $comment->comment_post_ID ); - return $comment->comment_approved; } diff --git a/plugins/internal-comments/src/Permissions.php b/plugins/internal-comments/src/Permissions.php index e816d90..dfbf092 100644 --- a/plugins/internal-comments/src/Permissions.php +++ b/plugins/internal-comments/src/Permissions.php @@ -121,7 +121,6 @@ public function guard_core_rest_comment( mixed $response, mixed $handler, \WP_RE */ public function exclude_from_core_rest_collections( array $args ): array { $args['type__not_in'] = dws_ic_exclude_internal_type( $args['type__not_in'] ?? array() ); - return $args; } diff --git a/plugins/internal-comments/src/Plugin.php b/plugins/internal-comments/src/Plugin.php index d556fa3..9327fb2 100644 --- a/plugins/internal-comments/src/Plugin.php +++ b/plugins/internal-comments/src/Plugin.php @@ -191,7 +191,6 @@ protected function compose(): bool { $this->kernel = new PluginKernel( new ContainerBuilder()->addDefinitions( $this->get_definitions( $this->logger, $this->scheduler ) )->build() ); $this->kernel->boot( self::COMPONENTS ); - return true; } diff --git a/plugins/internal-comments/src/RestRoutes.php b/plugins/internal-comments/src/RestRoutes.php index 854146c..e386292 100644 --- a/plugins/internal-comments/src/RestRoutes.php +++ b/plugins/internal-comments/src/RestRoutes.php @@ -135,7 +135,6 @@ public function register_routes(): void { */ public function can_read_post_comments( \WP_REST_Request $request ): bool { $post_id = absint( $request['post'] ); - return $this->can_use_post( $post_id ) && ( current_user_can( DWS_IC_CAP_SEE_METABOX ) || current_user_can( DWS_IC_CAP_SEE_COLUMN ) ); } @@ -272,7 +271,6 @@ public function create_comment( \WP_REST_Request $request ): \WP_REST_Response|\ */ public function get_comment( \WP_REST_Request $request ): \WP_REST_Response { $comment = dws_ic_get_comment( absint( $request['id'] ) ); - return new \WP_REST_Response( array( 'id' => absint( $request['id'] ), diff --git a/plugins/internal-comments/src/Settings.php b/plugins/internal-comments/src/Settings.php index 8a48e05..6b4b352 100644 --- a/plugins/internal-comments/src/Settings.php +++ b/plugins/internal-comments/src/Settings.php @@ -116,7 +116,6 @@ public function get_options_page( string $page_id ): array { */ public function add_settings_link( array $links ): array { \array_unshift( $links, \sprintf( '%s', esc_url( admin_url( 'options-general.php?page=' . self::PAGE ) ), esc_html__( 'Settings', 'internal-comments' ) ) ); - return $links; } diff --git a/plugins/internal-comments/tests/Integration/AdminScreensTest.php b/plugins/internal-comments/tests/Integration/AdminScreensTest.php index a8fa2f3..7d89a43 100644 --- a/plugins/internal-comments/tests/Integration/AdminScreensTest.php +++ b/plugins/internal-comments/tests/Integration/AdminScreensTest.php @@ -72,12 +72,10 @@ public function test_the_posts_list_column_follows_the_comments_column_and_passe $seen = array(); $v1 = static function ( string $column, ?string $post_type ) use ( &$seen ): string { $seen[] = array( 'v1', $column, $post_type ); - return $column; }; $v2 = static function ( string $column, ?string $post_type ) use ( &$seen ): string { $seen[] = array( 'v2', $column, $post_type ); - return 'title'; }; add_filter( self::V1_PRECEDING_COLUMN, $v1, 10, 2 ); @@ -262,7 +260,6 @@ public function test_the_comment_edit_screen_hides_the_fields_an_internal_commen $GLOBALS['comment'] = get_comment( $comment ); try { $screens->enqueue_comment_screen_style( 'comment.php' ); - return \implode( '', (array) wp_styles()->get_data( 'internal-comments-comment-screen', 'after' ) ); } finally { unset( $GLOBALS['comment'] ); @@ -291,7 +288,6 @@ public function test_the_comments_screen_counts_only_the_trashed_comments_the_us wp_get_current_user()->get_role_caps(); // An earlier row can leave the editor current with capabilities its role has since lost. $editor = (int) wp_count_comments()->trash; wp_set_current_user( self::$users['administrator'] ); - return array( $editor, (int) wp_count_comments()->trash ); }; $woocommerce = has_filter( 'wp_count_comments', array( 'WC_Comments', 'wp_count_comments' ) ); @@ -388,7 +384,6 @@ public function test_the_posts_list_loads_the_quick_views_assets(): void { protected function cell(): \Dom\HTMLDocument { \ob_start(); ( new AdminScreens() )->render_cell( 'dws-internal-comments', $this->post ); - return \Dom\HTMLDocument::createFromString( '' . \ob_get_clean() . '', \LIBXML_NOERROR ); } diff --git a/plugins/internal-comments/tests/Integration/CommentsTest.php b/plugins/internal-comments/tests/Integration/CommentsTest.php index eee0b43..e95dc20 100644 --- a/plugins/internal-comments/tests/Integration/CommentsTest.php +++ b/plugins/internal-comments/tests/Integration/CommentsTest.php @@ -68,13 +68,11 @@ public function test_the_creation_data_passes_v1s_filter_then_the_v2_filter(): v $seen = array(); $v1 = static function ( array $data ) use ( &$seen ): array { $seen[] = 'v1'; - return array( 'comment_content' => 'v1' ) + $data; }; $v2 = static function ( array $data ) use ( &$seen ): array { $seen[] = 'v2:' . $data['comment_content']; $data['comment_content'] = 'v2'; - return $data; }; add_filter( 'internal_comments/create_comment_data', $v1 ); diff --git a/plugins/internal-comments/tests/Integration/DataGuardsTest.php b/plugins/internal-comments/tests/Integration/DataGuardsTest.php index 57f14d5..35e861a 100644 --- a/plugins/internal-comments/tests/Integration/DataGuardsTest.php +++ b/plugins/internal-comments/tests/Integration/DataGuardsTest.php @@ -65,7 +65,6 @@ public function test_a_status_change_leaves_an_internal_comment_internal_and_not $mailed = array(); $record = static function ( mixed $result, array $mail ) use ( &$mailed ): bool { $mailed[] = $mail['subject']; - return true; }; $notify = get_option( 'comments_notify' ); diff --git a/plugins/internal-comments/tests/Integration/MetaBoxTest.php b/plugins/internal-comments/tests/Integration/MetaBoxTest.php index 6f97234..ca9ea97 100644 --- a/plugins/internal-comments/tests/Integration/MetaBoxTest.php +++ b/plugins/internal-comments/tests/Integration/MetaBoxTest.php @@ -180,7 +180,6 @@ protected function registers( string $role, int $post ): bool { wp_set_current_user( self::$users[ $role ] ); $type = (string) get_post_type( $post ); do_action( 'add_meta_boxes', $type, get_post( $post ) ); - return isset( $wp_meta_boxes[ $type ]['normal']['core']['dws-internal-comments'] ); } @@ -191,7 +190,6 @@ protected function render( string $role ): \Dom\HTMLDocument { $box = $wp_meta_boxes['post']['normal']['core']['dws-internal-comments']; \ob_start(); \call_user_func( $box['callback'], get_post( $this->post ), $box ); - return \Dom\HTMLDocument::createFromString( '' . \ob_get_clean() . '', \LIBXML_NOERROR ); } diff --git a/plugins/internal-comments/tests/Integration/MetadataTest.php b/plugins/internal-comments/tests/Integration/MetadataTest.php index 657eb10..e97bba9 100644 --- a/plugins/internal-comments/tests/Integration/MetadataTest.php +++ b/plugins/internal-comments/tests/Integration/MetadataTest.php @@ -51,7 +51,6 @@ protected static function get_listed_header( string $header ): string { protected static function translate_name(): \Closure { $name = self::get_listed_header( 'Name' ); - return static fn ( string $translation, string $text ): string => $name === $text ? self::TRANSLATION : $translation; } } diff --git a/plugins/internal-comments/tests/Integration/MigrationsTest.php b/plugins/internal-comments/tests/Integration/MigrationsTest.php index 20097dc..2f2a6af 100644 --- a/plugins/internal-comments/tests/Integration/MigrationsTest.php +++ b/plugins/internal-comments/tests/Integration/MigrationsTest.php @@ -120,7 +120,6 @@ public function test_the_second_step_converts_v1s_internal_comments_in_batches_a 'comment_date_gmt' => \current_time( 'mysql', true ), ) ); - return (int) $wpdb->insert_id; }; diff --git a/plugins/internal-comments/tests/Integration/OrdersTest.php b/plugins/internal-comments/tests/Integration/OrdersTest.php index f68f54f..19f05eb 100644 --- a/plugins/internal-comments/tests/Integration/OrdersTest.php +++ b/plugins/internal-comments/tests/Integration/OrdersTest.php @@ -120,7 +120,6 @@ protected function post_comment( string $role, int $order_id, string $content ): wp_set_current_user( self::$users[ $role ] ); $request = new \WP_REST_Request( 'POST', "/dws_ic/v1/posts/$order_id/comments" ); $request->set_param( 'content', $content ); - return rest_do_request( $request )->get_status(); } } diff --git a/plugins/internal-comments/tests/Integration/PermissionsTest.php b/plugins/internal-comments/tests/Integration/PermissionsTest.php index 5189f96..d9de004 100644 --- a/plugins/internal-comments/tests/Integration/PermissionsTest.php +++ b/plugins/internal-comments/tests/Integration/PermissionsTest.php @@ -168,7 +168,6 @@ protected function post( string $role ): int { ) ); $this->posts[] = $post; - return $post; } diff --git a/plugins/internal-comments/tests/Integration/SettingsApiTest.php b/plugins/internal-comments/tests/Integration/SettingsApiTest.php index bcf0154..4f63a73 100644 --- a/plugins/internal-comments/tests/Integration/SettingsApiTest.php +++ b/plugins/internal-comments/tests/Integration/SettingsApiTest.php @@ -111,18 +111,15 @@ public function test_a_validated_value_passes_the_v1_filters_of_its_path_then_th $filters = array( 'internal_comments/general_settings/get_validated_option_value' => static function ( mixed $value, string $field_id ) use ( &$seen ): mixed { $seen[] = array( 'group', $value, $field_id ); - return 'group'; }, 'internal_comments/settings/get_validated_option_value' => static function ( mixed $value, string $field_id ) use ( &$seen ): mixed { $seen[] = array( 'section', $value, $field_id ); - return 'section'; }, ); $v2 = static function ( mixed $value, string $field_id, string $group ) use ( &$seen ): mixed { $seen[] = array( 'v2', $value, $field_id, $group ); - return 'v2'; }; foreach ( $filters as $hook => $filter ) { diff --git a/plugins/internal-comments/tests/Integration/SettingsTest.php b/plugins/internal-comments/tests/Integration/SettingsTest.php index fdff2c9..bf30e74 100644 --- a/plugins/internal-comments/tests/Integration/SettingsTest.php +++ b/plugins/internal-comments/tests/Integration/SettingsTest.php @@ -138,7 +138,6 @@ public function test_a_groups_fields_pass_its_v1_filter_first_then_its_v2_filter $v2_hook = "dws_ic/settings/{$group}_fields"; $v1_extra = static function ( array $fields ) use ( &$seen ): array { $seen[] = array( 'v1', \array_keys( $fields ) ); - return $fields + array( 'extra' => array( 'type' => 'text', @@ -148,7 +147,6 @@ public function test_a_groups_fields_pass_its_v1_filter_first_then_its_v2_filter }; $v2_spy = static function ( array $fields ) use ( &$seen ): array { $seen[] = array( 'v2', \array_column( $fields, 'id' ) ); - return $fields; }; add_filter( $v1_hook, $v1_extra ); @@ -184,7 +182,6 @@ protected function render( string $tab ): \Dom\HTMLDocument { $_GET['tab'] = $tab; \ob_start(); self::$page->render_page(); - return \Dom\HTMLDocument::createFromString( '' . \ob_get_clean() . '', \LIBXML_NOERROR ); } diff --git a/plugins/internal-comments/tests/Support/RunsRequestsTrait.php b/plugins/internal-comments/tests/Support/RunsRequestsTrait.php index d776cf0..17a68af 100644 --- a/plugins/internal-comments/tests/Support/RunsRequestsTrait.php +++ b/plugins/internal-comments/tests/Support/RunsRequestsTrait.php @@ -15,7 +15,6 @@ protected static function request_provoking( string $diagnostic, string $php, st $provoked = '' === $diagnostic ? null : \array_find_key( $output, static fn ( string $line ): bool => \str_contains( $line, $diagnostic ) ); self::assertSame( array(), \array_slice( $output, 0, \is_int( $provoked ) ? $provoked : \max( 0, \count( $output ) - 1 ) ), \implode( "\n", $output ) ); - return array( 'status' => $status, 'output' => \implode( "\n", $output ), diff --git a/plugins/internal-comments/tests/Unit/ReadmeTest.php b/plugins/internal-comments/tests/Unit/ReadmeTest.php index ceecefe..682ef08 100644 --- a/plugins/internal-comments/tests/Unit/ReadmeTest.php +++ b/plugins/internal-comments/tests/Unit/ReadmeTest.php @@ -30,7 +30,6 @@ public function test_the_readme_holds_the_changelog_markers_the_sync_fills(): vo protected static function read_fields( string $file ): array { \preg_match_all( '/^[\s*]*([A-Za-z ]+):\s*(\S.*?)\s*$/m', (string) \file_get_contents( \dirname( __DIR__, 2 ) . "/$file" ), $matches ); - return \array_combine( $matches[1], $matches[2] ); } } diff --git a/plugins/linked-orders-for-woocommerce/includes/deprecated.php b/plugins/linked-orders-for-woocommerce/includes/deprecated.php index 3a6d144..9675397 100644 --- a/plugins/linked-orders-for-woocommerce/includes/deprecated.php +++ b/plugins/linked-orders-for-woocommerce/includes/deprecated.php @@ -96,7 +96,6 @@ */ function dws_lowc_name(): string { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lowc_get_plugin_name()' ); - return dws_lowc_get_plugin_name(); } @@ -111,7 +110,6 @@ function dws_lowc_name(): string { */ function dws_lowc_version(): string { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lowc_get_plugin_version()' ); - return dws_lowc_get_plugin_version(); } @@ -126,7 +124,6 @@ function dws_lowc_version(): string { */ function dws_lowc_path(): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return DWS_LOWC_PATH; } @@ -141,7 +138,6 @@ function dws_lowc_path(): string { */ function dws_lowc_min_php(): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return DWS_LOWC_MIN_PHP; } @@ -156,7 +152,6 @@ function dws_lowc_min_php(): string { */ function dws_lowc_min_wp(): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return DWS_LOWC_MIN_WP; } @@ -174,7 +169,6 @@ function dws_lowc_min_wp(): string { */ function dws_lowc_get_hook_tag( string $name, $extra = array() ): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return dws_lowc_join_v1_hook_tag( 'linked_orders_for_woocommerce', $name, $extra ); } @@ -193,7 +187,6 @@ function dws_lowc_get_hook_tag( string $name, $extra = array() ): string { */ function dws_lowc_get_component_hook_tag( string $component_id, string $name, $extra = array() ): ?string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return in_array( $component_id, DWS_LOWC_V1_COMPONENTS, true ) ? dws_lowc_join_v1_hook_tag( 'linked_orders_for_woocommerce/' . str_replace( '-', '_', $component_id ), $name, $extra ) : null; } diff --git a/plugins/linked-orders-for-woocommerce/includes/linking.php b/plugins/linked-orders-for-woocommerce/includes/linking.php index 2c84860..c8376a1 100644 --- a/plugins/linked-orders-for-woocommerce/includes/linking.php +++ b/plugins/linked-orders-for-woocommerce/includes/linking.php @@ -44,7 +44,6 @@ function dws_lowc_get_order_node( $order ): ?DWS_Order_Node { */ function dws_lowc_is_root_order( $order ): ?bool { $node = dws_lowc_get_order_node( $order ); - return null === $node ? null : 0 === $node->get_depth(); } diff --git a/plugins/linked-orders-for-woocommerce/includes/metadata.php b/plugins/linked-orders-for-woocommerce/includes/metadata.php index 690485e..ea31903 100644 --- a/plugins/linked-orders-for-woocommerce/includes/metadata.php +++ b/plugins/linked-orders-for-woocommerce/includes/metadata.php @@ -36,7 +36,6 @@ function dws_lowc_get_plugin_slug(): string { */ function dws_lowc_get_plugin_name(): string { $name = get_file_data( DWS_LOWC_FILE, array( 'Name' => 'Plugin Name' ) )['Name']; - return 0 < did_action( 'init' ) ? __( $name, 'linked-orders-for-woocommerce' ) : $name; // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText -- The header's name reaches the POT through make-pot's header extraction. } diff --git a/plugins/linked-orders-for-woocommerce/includes/options.php b/plugins/linked-orders-for-woocommerce/includes/options.php index 9b5737e..c57abf7 100644 --- a/plugins/linked-orders-for-woocommerce/includes/options.php +++ b/plugins/linked-orders-for-woocommerce/includes/options.php @@ -66,6 +66,5 @@ */ function dws_lowc_validate_max_depth( $submitted ) { $depth = is_string( $submitted ) ? filter_var( $submitted, FILTER_VALIDATE_INT, array( 'options' => array( 'min_range' => 1 ) ) ) : false; - return false === $depth ? new WP_Error( 'invalid_number', __( 'Enter a whole number of 1 or more, such as 2.', 'linked-orders-for-woocommerce' ) ) : (string) $depth; } diff --git a/plugins/linked-orders-for-woocommerce/includes/post-type.php b/plugins/linked-orders-for-woocommerce/includes/post-type.php index 1ce9d6c..0222c16 100644 --- a/plugins/linked-orders-for-woocommerce/includes/post-type.php +++ b/plugins/linked-orders-for-woocommerce/includes/post-type.php @@ -55,7 +55,6 @@ function dws_lowc_get_supported_order_types(): array { */ function dws_lowc_get_singular_name( WP_Post_Type $post_type ): string { $name = $post_type->labels->singular_name ?? null; - return is_string( $name ) ? $name : $post_type->label; } @@ -75,7 +74,6 @@ function dws_lowc_is_supported_order( $order ): ?bool { } $order = wc_get_order( $order ); - return $order instanceof WC_Order ? in_array( $order->get_type(), dws_lowc_get_supported_order_types(), true ) : null; } @@ -230,7 +228,6 @@ function dws_lowc_create_linked_child( int $parent_id, array $args = array() ) { $child->save(); if ( true !== dws_lowc_link_orders( $parent_id, $child->get_id() ) ) { $child->delete( true ); - return new WP_Error( 'dws_lowc_link_refused', __( 'another order was being linked at the same time. Please try again.', 'linked-orders-for-woocommerce' ) ); } diff --git a/plugins/linked-orders-for-woocommerce/includes/settings.php b/plugins/linked-orders-for-woocommerce/includes/settings.php index 149293b..a3dc9e4 100644 --- a/plugins/linked-orders-for-woocommerce/includes/settings.php +++ b/plugins/linked-orders-for-woocommerce/includes/settings.php @@ -33,7 +33,6 @@ */ function dws_lowc_get_raw_setting( string $field_id, ?string $group = null ) { $field = dws_lowc_find_setting( $field_id, $group ); - return null === $field ? null : get_option( $field[2], null ); } diff --git a/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php b/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php index 46d7a0d..a4ef5b9 100644 --- a/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php +++ b/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php @@ -147,7 +147,6 @@ public function __get( string $name ): mixed { */ public function __call( string $name, array $arguments ): mixed { $method = array( $this->order, $name ); - return is_callable( $method ) ? $method( ...$arguments ) : null; } @@ -189,7 +188,6 @@ public function get_post_type(): WP_Post_Type { */ public function get_depth(): int { $this->maybe_read(); - return $this->depth; } @@ -233,7 +231,6 @@ public function has_parent(): bool { public function get_children(): array { $this->maybe_read(); $this->children ??= array_values( array_filter( array_map( static fn ( ?int $id ): ?DWS_Order_Node => dws_lowc_get_order_node( $id ), $this->child_ids ) ) ); - return $this->children; } @@ -323,7 +320,6 @@ public function add_child( DWS_Order_Node $child ): bool { $child->set_parent( $this ); $this->children = array( ...$this->get_children(), $child ); - return true; } diff --git a/plugins/linked-orders-for-woocommerce/src/ListTable.php b/plugins/linked-orders-for-woocommerce/src/ListTable.php index 17d21e3..1c48077 100644 --- a/plugins/linked-orders-for-woocommerce/src/ListTable.php +++ b/plugins/linked-orders-for-woocommerce/src/ListTable.php @@ -96,7 +96,6 @@ public function insert_depth_column( array $columns ): array { $preceding = apply_filters( 'dws_lowc/list_table/preceding_column', $preceding, $type, $columns ); $position = \array_search( $preceding, \array_keys( $columns ), true ); $position = false === $position ? \count( $columns ) : $position + 1; - return \array_slice( $columns, 0, $position, true ) + array( 'dws_lo_depth' => _x( 'Depth', 'list table heading', 'linked-orders-for-woocommerce' ) ) + \array_slice( $columns, $position, null, true ); } @@ -382,7 +381,6 @@ protected static function get_deepest_level( string $type ): int { ) ); $stored = \is_array( $deepest ) && array() !== $deepest ? dws_lowc_get_order_node( \reset( $deepest ) )?->get_depth() : null; - return \max( dws_lowc_get_max_depth(), $stored ?? 0 ); } @@ -396,7 +394,6 @@ protected static function get_deepest_level( string $type ): int { */ protected static function get_depth_filter(): ?int { $depth = \filter_var( self::get_query_arg( '_dws_lo_depth' ), \FILTER_VALIDATE_INT, array( 'options' => array( 'min_range' => 0 ) ) ); - return false === $depth ? null : $depth; } @@ -418,7 +415,6 @@ protected static function get_depth_clauses(): array { 'key' => '_dws_lo_depth', 'value' => (string) $depth, ); - return array( 0 === $depth ? array( 'relation' => 'OR', diff --git a/plugins/linked-orders-for-woocommerce/src/Plugin.php b/plugins/linked-orders-for-woocommerce/src/Plugin.php index 72bb34b..a3e8941 100644 --- a/plugins/linked-orders-for-woocommerce/src/Plugin.php +++ b/plugins/linked-orders-for-woocommerce/src/Plugin.php @@ -196,7 +196,6 @@ protected function compose(): bool { $this->kernel = new PluginKernel( new ContainerBuilder()->addDefinitions( $this->get_definitions( $this->logger, $this->scheduler ) )->build() ); $this->kernel->boot( self::COMPONENTS ); - return true; } diff --git a/plugins/linked-orders-for-woocommerce/src/Settings.php b/plugins/linked-orders-for-woocommerce/src/Settings.php index f14647d..cdb8258 100644 --- a/plugins/linked-orders-for-woocommerce/src/Settings.php +++ b/plugins/linked-orders-for-woocommerce/src/Settings.php @@ -145,7 +145,6 @@ public function register_section( SettingsSectionRegistry $registry ): void { */ public function add_settings_link( array $links ): array { \array_unshift( $links, \sprintf( '%s', esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced§ion=' . self::SECTION ) ), esc_html__( 'Settings', 'linked-orders-for-woocommerce' ) ) ); - return $links; } diff --git a/plugins/linked-orders-for-woocommerce/tests/Fixtures/sequential-order-numbers-pro.php b/plugins/linked-orders-for-woocommerce/tests/Fixtures/sequential-order-numbers-pro.php index 96af337..a4e3f4b 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Fixtures/sequential-order-numbers-pro.php +++ b/plugins/linked-orders-for-woocommerce/tests/Fixtures/sequential-order-numbers-pro.php @@ -15,6 +15,5 @@ function wc_seq_order_number_pro(): WC_Seq_Order_Number_Pro { static $plugin = null; $plugin ??= new WC_Seq_Order_Number_Pro(); - return $plugin; } diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/AutocompletionTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/AutocompletionTest.php index 33c4601..876a848 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/AutocompletionTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/AutocompletionTest.php @@ -49,7 +49,6 @@ public function test_the_completed_order_passes_the_filters_before_its_descendan $seen = array(); $record = static function ( bool $should, int $order_id ) use ( &$seen ): bool { $seen[] = $order_id; - return $should; }; add_filter( 'dws_lowc/autocompletion/should_autocomplete', $record, 10, 2 ); @@ -112,7 +111,6 @@ protected function create_tree(): array { $grandchild = $this->create_order(); self::assertTrue( dws_lowc_link_orders( $root->get_id(), $child->get_id() ) ); self::assertTrue( dws_lowc_link_orders( $child->get_id(), $grandchild->get_id() ) ); - return array( wc_get_order( $root->get_id() ), wc_get_order( $child->get_id() ), wc_get_order( $grandchild->get_id() ) ); } } diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/DeprecatedHooksTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/DeprecatedHooksTest.php index 6605f90..575d335 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/DeprecatedHooksTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/DeprecatedHooksTest.php @@ -51,7 +51,6 @@ public function test_a_renamed_hook_fires_its_v1_literal_then_its_v2_name( strin $fired = array(); $spy = static function ( mixed $value = null ) use ( &$fired ): mixed { $fired[] = current_filter(); - return $value; }; add_filter( $v1, $spy ); @@ -137,7 +136,6 @@ protected function open_list(): string { require_once ABSPATH . 'wp-admin/includes/screen.php'; $screen = wc_get_page_screen_id( 'shop-order' ); set_current_screen( $screen ); - return $screen; } } diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/ListTableTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/ListTableTest.php index 72b88a9..09720b0 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/ListTableTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/ListTableTest.php @@ -287,7 +287,6 @@ protected function open_list(): string { $screen = OrderUtil::custom_orders_table_usage_is_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'edit-shop_order'; set_current_screen( $screen ); $GLOBALS['typenow'] = 'shop_order'; - return $screen; } @@ -328,7 +327,6 @@ protected function query( ?array $found = null, array $meta_query = array() ): a 'order' => 'ASC', ) ); - return \array_map( 'intval', wc_get_orders( $args ) ); } @@ -343,7 +341,6 @@ protected function query( ?array $found = null, array $meta_query = array() ): a 'order' => 'ASC', ) ); - return \array_map( 'intval', ( new \WP_Query( $vars ) )->posts ); } } diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/MetaBoxTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/MetaBoxTest.php index 76e725e..84ae866 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/MetaBoxTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/MetaBoxTest.php @@ -130,7 +130,6 @@ protected function register( \WC_Order|\WP_Post $post_or_order, ?string $screen self::assertInstanceOf( \WP_Post::class, $post_or_order ); } do_action( 'add_meta_boxes', $screen, $post_or_order ); - return $wp_meta_boxes[ $screen ]['side']['default']['dws-linked-orders'] ?? null; } @@ -142,7 +141,6 @@ protected function render( int $order_id ): \Dom\HTMLDocument { \ob_start(); \call_user_func( $box['callback'], $order, $box ); - return \Dom\HTMLDocument::createFromString( '' . \ob_get_clean() . '', \LIBXML_NOERROR ); } } diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/MetadataTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/MetadataTest.php index 5580493..0f66a61 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/MetadataTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/MetadataTest.php @@ -51,7 +51,6 @@ protected static function get_listed_header( string $header ): string { protected static function translate_name(): \Closure { $name = self::get_listed_header( 'Name' ); - return static fn ( string $translation, string $text ): string => $name === $text ? self::TRANSLATION : $translation; } } diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsApiTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsApiTest.php index 4037dfe..3663bf2 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsApiTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsApiTest.php @@ -105,18 +105,15 @@ public function test_a_validated_value_passes_the_v1_filters_of_its_path_then_th $filters = array( 'linked_orders_for_woocommerce/general_settings/get_validated_option_value' => static function ( mixed $value, string $field_id ) use ( &$seen ): mixed { $seen[] = array( 'group', $value, $field_id ); - return 4; }, 'linked_orders_for_woocommerce/settings/get_validated_option_value' => static function ( mixed $value, string $field_id ) use ( &$seen ): mixed { $seen[] = array( 'section', $value, $field_id ); - return 5; }, ); $v2 = static function ( mixed $value, string $field_id, string $group ) use ( &$seen ): mixed { $seen[] = array( 'v2', $value, $field_id, $group ); - return 6; }; foreach ( $filters as $hook => $filter ) { diff --git a/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsTest.php b/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsTest.php index df51043..062bba6 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Integration/SettingsTest.php @@ -117,7 +117,6 @@ public function test_a_groups_fields_pass_its_v1_filter_first_then_its_v2_filter $v2_hook = "dws_lowc/settings/{$group}_fields"; $v1_extra = static function ( array $fields ) use ( &$seen ): array { $seen[] = array( 'v1', \array_keys( $fields ) ); - return $fields + array( 'extra' => array( 'type' => 'text', @@ -127,7 +126,6 @@ public function test_a_groups_fields_pass_its_v1_filter_first_then_its_v2_filter }; $v2_spy = static function ( array $fields ) use ( &$seen ): array { $seen[] = array( 'v2', \array_column( $fields, 'id' ) ); - return $fields; }; add_filter( $v1_hook, $v1_extra ); @@ -161,7 +159,6 @@ public function test_the_plugin_row_links_to_the_section_and_to_the_support_foru protected function render(): \Dom\HTMLDocument { \ob_start(); \WC_Admin_Settings::output_fields( self::$advanced->get_settings_for_section( self::SECTION ) ); - return \Dom\HTMLDocument::createFromString( '' . \ob_get_clean() . '', \LIBXML_NOERROR ); } diff --git a/plugins/linked-orders-for-woocommerce/tests/Support/RunsRequestsTrait.php b/plugins/linked-orders-for-woocommerce/tests/Support/RunsRequestsTrait.php index f1a9d68..09d3ec9 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Support/RunsRequestsTrait.php +++ b/plugins/linked-orders-for-woocommerce/tests/Support/RunsRequestsTrait.php @@ -15,7 +15,6 @@ protected static function request_provoking( string $diagnostic, string $php, st $provoked = '' === $diagnostic ? null : \array_find_key( $output, static fn ( string $line ): bool => \str_contains( $line, $diagnostic ) ); self::assertSame( array(), \array_slice( $output, 0, \is_int( $provoked ) ? $provoked : \max( 0, \count( $output ) - 1 ) ), \implode( "\n", $output ) ); - return array( 'status' => $status, 'output' => \implode( "\n", $output ), diff --git a/plugins/linked-orders-for-woocommerce/tests/Unit/ReadmeTest.php b/plugins/linked-orders-for-woocommerce/tests/Unit/ReadmeTest.php index 42f80d1..f014d5c 100644 --- a/plugins/linked-orders-for-woocommerce/tests/Unit/ReadmeTest.php +++ b/plugins/linked-orders-for-woocommerce/tests/Unit/ReadmeTest.php @@ -30,7 +30,6 @@ public function test_the_readme_holds_the_changelog_markers_the_sync_fills(): vo protected static function read_fields( string $file ): array { \preg_match_all( '/^[\s*]*([A-Za-z ]+):\s*(\S.*?)\s*$/m', (string) \file_get_contents( \dirname( __DIR__, 2 ) . "/$file" ), $matches ); - return \array_combine( $matches[1], $matches[2] ); } } diff --git a/plugins/locked-payment-methods-for-woocommerce/includes/deprecated.php b/plugins/locked-payment-methods-for-woocommerce/includes/deprecated.php index e0604d2..0d653bb 100644 --- a/plugins/locked-payment-methods-for-woocommerce/includes/deprecated.php +++ b/plugins/locked-payment-methods-for-woocommerce/includes/deprecated.php @@ -115,7 +115,6 @@ */ function dws_lpmwc_name(): string { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_get_plugin_name()' ); - return dws_lpmwc_get_plugin_name(); } @@ -130,7 +129,6 @@ function dws_lpmwc_name(): string { */ function dws_lpmwc_version(): string { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_get_plugin_version()' ); - return dws_lpmwc_get_plugin_version(); } @@ -145,7 +143,6 @@ function dws_lpmwc_version(): string { */ function dws_lpmwc_path(): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return DWS_LPMWC_PATH; } @@ -160,7 +157,6 @@ function dws_lpmwc_path(): string { */ function dws_lpmwc_min_php(): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return DWS_LPMWC_MIN_PHP; } @@ -175,7 +171,6 @@ function dws_lpmwc_min_php(): string { */ function dws_lpmwc_min_wp(): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return DWS_LPMWC_MIN_WP; } @@ -193,7 +188,6 @@ function dws_lpmwc_min_wp(): string { */ function dws_lpmwc_get_hook_tag( string $name, $extra = array() ): string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return dws_lpmwc_join_v1_hook_tag( 'locked_payment_methods_for_woocommerce', $name, $extra ); } @@ -212,7 +206,6 @@ function dws_lpmwc_get_hook_tag( string $name, $extra = array() ): string { */ function dws_lpmwc_get_component_hook_tag( string $component_id, string $name, $extra = array() ): ?string { _deprecated_function( __FUNCTION__, '2.0.0' ); - return isset( DWS_LPMWC_V1_COMPONENTS[ $component_id ] ) ? dws_lpmwc_join_v1_hook_tag( 'locked_payment_methods_for_woocommerce/' . DWS_LPMWC_V1_COMPONENTS[ $component_id ], $name, $extra ) : null; } @@ -301,7 +294,6 @@ function dws_lpmwc_check_payment_method_access_for_user( string $locked_method_i * @param int $user_id The user's id. */ $lock = apply_filters_deprecated( 'locked_payment_methods_for_woocommerce/check_payment_method_access_for_user', array( true, $locked_method_id, $user_id ), '2.0.0', 'dws_lpmwc/payment_method/should_lock' ); - return dws_lpmwc_should_lock( false !== $lock, $locked_method_id, $user_id, 0 ); } @@ -333,7 +325,6 @@ function dws_lpmwc_check_payment_method_access_for_wc_order( string $locked_meth * @param int $order_id The order's id. */ $lock = apply_filters_deprecated( 'locked_payment_methods_for_woocommerce/check_payment_method_access_for_wc_order', array( true, $locked_method_id, $order_id ), '2.0.0', 'dws_lpmwc/payment_method/should_lock' ); - return dws_lpmwc_should_lock( false !== $lock, $locked_method_id, $order instanceof WC_Order ? $order->get_customer_id() : 0, $order_id ); } @@ -351,7 +342,6 @@ function dws_lpmwc_check_payment_method_access_for_wc_order( string $locked_meth */ function dws_lpmwc_check_payment_method_access_via_user_meta( string $locked_method_id, int $user_id ): bool { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_is_payment_method_locked()' ); - return ! ( UserProfileStrategy::should_load() && UserProfileStrategy::unlocks( $locked_method_id, $user_id ) ); } @@ -369,7 +359,6 @@ function dws_lpmwc_check_payment_method_access_via_user_meta( string $locked_met */ function dws_lpmwc_check_payment_method_access_via_user_roles( string $locked_method_id, int $user_id ): bool { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_is_payment_method_locked()' ); - return ! ( UserRoleStrategy::should_load() && UserRoleStrategy::unlocks( $locked_method_id, $user_id ) ); } @@ -387,7 +376,6 @@ function dws_lpmwc_check_payment_method_access_via_user_roles( string $locked_me */ function dws_lpmwc_check_payment_method_access_via_groups( string $locked_method_id, int $user_id ): bool { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_is_payment_method_locked()' ); - return ! ( GroupsStrategy::should_load() && GroupsStrategy::unlocks( $locked_method_id, $user_id ) ); } @@ -405,7 +393,6 @@ function dws_lpmwc_check_payment_method_access_via_groups( string $locked_method */ function dws_lpmwc_check_payment_method_access_via_wc_memberships( string $locked_method_id, int $user_id ): bool { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_is_payment_method_locked()' ); - return ! ( WooCommerceMembershipsStrategy::should_load() && WooCommerceMembershipsStrategy::unlocks( $locked_method_id, $user_id ) ); } @@ -423,7 +410,6 @@ function dws_lpmwc_check_payment_method_access_via_wc_memberships( string $locke */ function dws_lpmwc_check_payment_method_access_via_wc_order_meta( string $locked_method_id, int $order_id ): bool { _deprecated_function( __FUNCTION__, '2.0.0', 'dws_lpmwc_is_payment_method_locked()' ); - return ! ( OrderStrategy::should_load() && OrderStrategy::unlocks( $locked_method_id, $order_id ) ); } @@ -442,7 +428,6 @@ function dws_lpmwc_check_payment_method_access_via_wc_order_meta( string $locked function dws_lpmwc_get_raw_setting( string $field_id, ?string $group = null ) { _deprecated_function( __FUNCTION__, '2.0.0', 'get_option()' ); $setting = dws_lpmwc_find_v1_setting( $field_id, $group ); - return null === $setting ? null : get_option( $setting['key'], null ); } @@ -460,7 +445,6 @@ function dws_lpmwc_get_raw_setting( string $field_id, ?string $group = null ) { */ function dws_lpmwc_get_validated_setting( string $field_id, ?string $group = null ) { _deprecated_function( __FUNCTION__, '2.0.0', 'get_option()' ); - return dws_lpmwc_read_v1_setting( $field_id, $group ); } @@ -480,7 +464,6 @@ function dws_lpmwc_get_validated_setting( string $field_id, ?string $group = nul function dws_lpmwc_validate_setting( $value, string $field_id, ?string $group = null ) { _deprecated_function( __FUNCTION__, '2.0.0' ); $setting = dws_lpmwc_find_v1_setting( $field_id, $group ); - return null === $setting ? null : dws_lpmwc_validate_v1_setting( $value, $setting['key'] ); } @@ -497,7 +480,6 @@ function dws_lpmwc_validate_setting( $value, string $field_id, ?string $group = */ function dws_lpmwc_get_validated_general_setting( string $field_id ) { _deprecated_function( __FUNCTION__, '2.0.0', 'get_option()' ); - return dws_lpmwc_read_v1_setting( $field_id, 'general' ); } @@ -522,7 +504,6 @@ function dws_lpmwc_find_v1_setting( string $field_id, ?string $group ): ?array { } $key = DWS_LPMWC_V1_SETTINGS[ $group ][ $field_id ] ?? null; - return null === $key ? null : array( 'group' => $group, 'field' => $field_id, diff --git a/plugins/locked-payment-methods-for-woocommerce/includes/grants.php b/plugins/locked-payment-methods-for-woocommerce/includes/grants.php index 93eebb0..8f6b31c 100644 --- a/plugins/locked-payment-methods-for-woocommerce/includes/grants.php +++ b/plugins/locked-payment-methods-for-woocommerce/includes/grants.php @@ -32,7 +32,6 @@ */ function dws_lpmwc_get_user_grants_key(): string { global $wpdb; - return $wpdb->get_blog_prefix() . DWS_LPMWC_USER_OPTION_UNLOCKED_METHODS; } @@ -48,7 +47,6 @@ function dws_lpmwc_get_user_grants_key(): string { */ function dws_lpmwc_get_user_unlocked_payment_method_ids( int $user_id ): array { $ids = get_user_meta( $user_id, dws_lpmwc_get_user_grants_key(), true ); - return is_array( $ids ) ? array_values( array_filter( $ids, 'is_string' ) ) : array(); } @@ -75,7 +73,6 @@ function dws_lpmwc_get_user_unlocked_payment_method_ids( int $user_id ): array { function dws_lpmwc_get_order_unlocked_payment_method_ids( int $order_id ): array { $order = 0 === $order_id ? false : wc_get_order( $order_id ); $ids = $order instanceof WC_Order ? $order->get_meta( DWS_LPMWC_META_UNLOCKED_METHODS ) : array(); - return is_array( $ids ) ? array_values( array_filter( $ids, 'is_string' ) ) : array(); } @@ -91,7 +88,6 @@ function dws_lpmwc_get_order_unlocked_payment_method_ids( int $order_id ): array */ function dws_lpmwc_get_payment_method_title( string $gateway_id ): string { $gateway = WC()->payment_gateways()->payment_gateways()[ $gateway_id ] ?? null; - return $gateway instanceof WC_Payment_Gateway ? $gateway->get_title() : $gateway_id; } @@ -166,7 +162,6 @@ function dws_lpmwc_get_groups_unlocked_payment_method_ids(): array { */ function dws_lpmwc_get_plan_unlocked_payment_method_ids( int $plan_id ): array { $ids = get_post_meta( $plan_id, DWS_LPMWC_META_UNLOCKED_METHODS, true ); - return is_array( $ids ) ? array_values( array_filter( $ids, 'is_string' ) ) : array(); } diff --git a/plugins/locked-payment-methods-for-woocommerce/includes/metadata.php b/plugins/locked-payment-methods-for-woocommerce/includes/metadata.php index 421f217..36fff2b 100644 --- a/plugins/locked-payment-methods-for-woocommerce/includes/metadata.php +++ b/plugins/locked-payment-methods-for-woocommerce/includes/metadata.php @@ -36,7 +36,6 @@ function dws_lpmwc_get_plugin_slug(): string { */ function dws_lpmwc_get_plugin_name(): string { $name = get_file_data( DWS_LPMWC_FILE, array( 'Name' => 'Plugin Name' ) )['Name']; - return 0 < did_action( 'init' ) ? __( $name, 'locked-payment-methods-for-woocommerce' ) : $name; // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText -- The header's name reaches the POT through make-pot's header extraction. } diff --git a/plugins/locked-payment-methods-for-woocommerce/includes/options.php b/plugins/locked-payment-methods-for-woocommerce/includes/options.php index aa269f8..2b4ade1 100644 --- a/plugins/locked-payment-methods-for-woocommerce/includes/options.php +++ b/plugins/locked-payment-methods-for-woocommerce/includes/options.php @@ -146,7 +146,6 @@ */ function dws_lpmwc_get_bool_option( string $key ): bool { $default = dws_lpmwc_get_option_default( $key ); - return filter_var( get_option( $key, $default ), FILTER_VALIDATE_BOOL, FILTER_NULL_ON_FAILURE ) ?? ( true === $default ); } @@ -162,7 +161,6 @@ function dws_lpmwc_get_bool_option( string $key ): bool { */ function dws_lpmwc_get_int_option( string $key ): int { $default = dws_lpmwc_get_option_default( $key ); - return filter_var( get_option( $key, $default ), FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE ) ?? ( is_int( $default ) ? $default : 0 ); } @@ -201,7 +199,6 @@ function dws_lpmwc_get_list_option( string $key ): array { $default = dws_lpmwc_get_option_default( $key ); $stored = get_option( $key, $default ); $stored = is_array( $stored ) ? $stored : $default; - return is_array( $stored ) ? array_values( array_filter( $stored, 'is_string' ) ) : array(); } diff --git a/plugins/locked-payment-methods-for-woocommerce/includes/safeguards.php b/plugins/locked-payment-methods-for-woocommerce/includes/safeguards.php index 90ec834..da23dc0 100644 --- a/plugins/locked-payment-methods-for-woocommerce/includes/safeguards.php +++ b/plugins/locked-payment-methods-for-woocommerce/includes/safeguards.php @@ -159,7 +159,6 @@ function dws_lpmwc_get_paid_order_id(): int { $order = wc_get_order( $wp->query_vars['order-pay'] ?? 0 ); $key = isset( $_GET['key'] ) && is_string( $_GET['key'] ) ? sanitize_text_field( wp_unslash( $_GET['key'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- The order key authorizes paying the order, as on WooCommerce's order-pay page. - return $order instanceof WC_Order && '' !== $key && hash_equals( $order->get_order_key(), $key ) ? $order->get_id() : 0; } diff --git a/plugins/locked-payment-methods-for-woocommerce/src/Plugin.php b/plugins/locked-payment-methods-for-woocommerce/src/Plugin.php index dd05dc3..94fb533 100644 --- a/plugins/locked-payment-methods-for-woocommerce/src/Plugin.php +++ b/plugins/locked-payment-methods-for-woocommerce/src/Plugin.php @@ -201,7 +201,6 @@ protected function compose(): bool { $this->kernel = new PluginKernel( new ContainerBuilder()->addDefinitions( $this->get_definitions( $this->logger, $this->scheduler ) )->build() ); $this->kernel->boot( self::COMPONENTS ); - return true; } diff --git a/plugins/locked-payment-methods-for-woocommerce/src/Settings.php b/plugins/locked-payment-methods-for-woocommerce/src/Settings.php index 4d2833b..7dec0ef 100644 --- a/plugins/locked-payment-methods-for-woocommerce/src/Settings.php +++ b/plugins/locked-payment-methods-for-woocommerce/src/Settings.php @@ -136,7 +136,6 @@ public function register_section( SettingsSectionRegistry $registry ): void { */ public function add_settings_link( array $links ): array { \array_unshift( $links, \sprintf( '%s', esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced§ion=' . self::SECTION ) ), esc_html__( 'Settings', 'locked-payment-methods-for-woocommerce' ) ) ); - return $links; } diff --git a/plugins/locked-payment-methods-for-woocommerce/src/UnlockStrategies/GroupsStrategy.php b/plugins/locked-payment-methods-for-woocommerce/src/UnlockStrategies/GroupsStrategy.php index 69b5ee5..c70a61b 100644 --- a/plugins/locked-payment-methods-for-woocommerce/src/UnlockStrategies/GroupsStrategy.php +++ b/plugins/locked-payment-methods-for-woocommerce/src/UnlockStrategies/GroupsStrategy.php @@ -105,7 +105,6 @@ public function register_hooks(): void { */ public static function is_available(): bool { $version = \defined( 'GROUPS_CORE_VERSION' ) ? \constant( 'GROUPS_CORE_VERSION' ) : null; - return \is_string( $version ) && \class_exists( \Groups_User::class ) && \version_compare( $version, '2.11.0', '>=' ); } @@ -175,7 +174,6 @@ public function render_group_field( string $output, int $group_id = 0 ): string } $value = dws_lpmwc_get_groups_unlocked_payment_method_ids()[ $group_id ] ?? array(); - return $output . '' . esc_html( $field['title'] ) . '
' . Forms::render_control( $field, $value, self::ENTRY . '[' . self::FIELD . ']', self::FIELD ) . 'comment_type ) { + if ( is_null( $comment ) || DWS_IC_COMMENT_TYPE !== $comment->comment_type ) { throw new InvalidArgumentException( 'The comment is not an internal comment.' ); } diff --git a/plugins/internal-comments/src/AdminScreens.php b/plugins/internal-comments/src/AdminScreens.php index 2d84914..8d2f573 100644 --- a/plugins/internal-comments/src/AdminScreens.php +++ b/plugins/internal-comments/src/AdminScreens.php @@ -247,7 +247,7 @@ public function render_cell( string $column, int $post_id ): void { */ public function enqueue_list_assets( string $hook_suffix ): void { $screen = \function_exists( 'get_current_screen' ) ? get_current_screen() : null; - $post_type = null === $screen || '' === $screen->post_type ? 'post' : $screen->post_type; + $post_type = \is_null( $screen ) || '' === $screen->post_type ? 'post' : $screen->post_type; if ( 1 === \preg_match( '/^woocommerce_page_wc-orders(?:--(.+))?$/', $hook_suffix, $matches ) && ! isset( $_GET['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Tells the list from the edit screen. $post_type = $matches[1] ?? 'shop_order'; } elseif ( 'edit.php' !== $hook_suffix ) { @@ -543,7 +543,7 @@ public function render_revisions( \WP_Comment $comment ): void { */ public function add_privacy_field( string $html, \WP_Comment $comment ): string { $is_private = dws_ic_is_private_comment( $comment ); - if ( null === $is_private || ( ! $is_private && ! dws_ic_are_enabled_private_comments() ) ) { + if ( \is_null( $is_private ) || ( ! $is_private && ! dws_ic_are_enabled_private_comments() ) ) { return $html; } diff --git a/plugins/internal-comments/src/Comments.php b/plugins/internal-comments/src/Comments.php index ed42ebe..ccab769 100644 --- a/plugins/internal-comments/src/Comments.php +++ b/plugins/internal-comments/src/Comments.php @@ -70,12 +70,12 @@ public function keep_internal( int|string $comment_id ): void { */ public function keep_inserted_internal( int|string $comment_id ): void { $replaced = $this->put_back( $comment_id ); - if ( null === $replaced ) { + if ( \is_null( $replaced ) ) { return; } $comment = dws_ic_get_comment( $comment_id ); - if ( null !== $comment ) { + if ( ! \is_null( $comment ) ) { wp_transition_comment_status( DWS_IC_COMMENT_STATUS, $replaced, $comment ); } } @@ -98,7 +98,7 @@ public function announce_kept_internal( int|string $new_status, int|string $old_ } $stored = dws_ic_get_comment( (int) $comment->comment_ID ); - if ( null !== $stored && DWS_IC_COMMENT_STATUS === $stored->comment_approved ) { + if ( ! \is_null( $stored ) && DWS_IC_COMMENT_STATUS === $stored->comment_approved ) { wp_transition_comment_status( DWS_IC_COMMENT_STATUS, (string) $new_status, $stored ); } } @@ -275,7 +275,7 @@ public function guard_privacy( mixed $check, int $comment_id, string $meta_key, } $comment = dws_ic_get_comment( $comment_id ); - return null !== $comment && get_current_user_id() !== (int) $comment->user_id ? false : $check; + return ! \is_null( $comment ) && get_current_user_id() !== (int) $comment->user_id ? false : $check; } // endregion @@ -298,7 +298,7 @@ protected function put_back( int|string $comment_id ): ?string { global $wpdb; $comment = dws_ic_get_comment( $comment_id ); - if ( null === $comment || DWS_IC_COMMENT_TYPE !== $comment->comment_type || \in_array( $comment->comment_approved, array( DWS_IC_COMMENT_STATUS, 'trash', 'post-trashed' ), true ) ) { + if ( \is_null( $comment ) || DWS_IC_COMMENT_TYPE !== $comment->comment_type || \in_array( $comment->comment_approved, array( DWS_IC_COMMENT_STATUS, 'trash', 'post-trashed' ), true ) ) { return null; } diff --git a/plugins/internal-comments/src/Permissions.php b/plugins/internal-comments/src/Permissions.php index dfbf092..fcc2904 100644 --- a/plugins/internal-comments/src/Permissions.php +++ b/plugins/internal-comments/src/Permissions.php @@ -62,7 +62,7 @@ public function map_meta_cap( array $caps, string $cap, int $user_id, array $arg $comment = dws_ic_get_comment( $args[0] ?? null ); $owners = dws_ic_get_private_comment_owners( $comment ); - if ( null === $comment || null === $owners ) { + if ( \is_null( $comment ) || \is_null( $owners ) ) { return array( 'do_not_allow' ); } @@ -102,7 +102,7 @@ public function guard_core_rest_comment( mixed $response, mixed $handler, \WP_RE default => null, } : null; $comment_id = \is_numeric( $request['id'] ) ? (int) $request['id'] : 0; - if ( \is_wp_error( $response ) || null === $capability || true !== dws_ic_is_internal_comment( $comment_id ) || current_user_can( $capability, $comment_id ) ) { + if ( \is_wp_error( $response ) || \is_null( $capability ) || true !== dws_ic_is_internal_comment( $comment_id ) || current_user_can( $capability, $comment_id ) ) { return $response; } diff --git a/plugins/internal-comments/src/RestRoutes.php b/plugins/internal-comments/src/RestRoutes.php index e386292..a18180a 100644 --- a/plugins/internal-comments/src/RestRoutes.php +++ b/plugins/internal-comments/src/RestRoutes.php @@ -213,7 +213,7 @@ public function create_comment( \WP_REST_Request $request ): \WP_REST_Response|\ } $parent = 0 === $parent_id ? null : dws_ic_get_comment( $parent_id ); - if ( 0 !== $parent_id && ( null === $parent || DWS_IC_COMMENT_TYPE !== $parent->comment_type || (int) $parent->comment_post_ID !== $post_id || ! current_user_can( 'see_dws_internal_comment', $parent_id ) ) ) { + if ( 0 !== $parent_id && ( \is_null( $parent ) || DWS_IC_COMMENT_TYPE !== $parent->comment_type || (int) $parent->comment_post_ID !== $post_id || ! current_user_can( 'see_dws_internal_comment', $parent_id ) ) ) { return new \WP_Error( 'dws_ic_invalid_parent', __( 'The comment you are replying to is not one of this item\'s internal comments.', 'internal-comments' ), array( 'status' => 400 ) ); } @@ -252,7 +252,7 @@ public function create_comment( \WP_REST_Request $request ): \WP_REST_Response|\ 'comment_meta' => array( DWS_IC_META_PRIVATE => $private ? 'yes' : 'no' ), ) ); - if ( null === $comment_id ) { + if ( \is_null( $comment_id ) ) { return new \WP_Error( 'dws_ic_not_stored', __( 'The internal comment could not be stored. Please try again.', 'internal-comments' ), array( 'status' => 500 ) ); } @@ -274,7 +274,7 @@ public function get_comment( \WP_REST_Request $request ): \WP_REST_Response { return new \WP_REST_Response( array( 'id' => absint( $request['id'] ), - 'content' => null === $comment ? '' : $comment->comment_content, + 'content' => \is_null( $comment ) ? '' : $comment->comment_content, ) ); } @@ -297,7 +297,7 @@ public function update_comment( \WP_REST_Request $request ): \WP_REST_Response|\ } $stored = dws_ic_get_comment( $comment_id ); - $comment = null === $stored ? array() : $stored->to_array(); + $comment = \is_null( $stored ) ? array() : $stored->to_array(); $data = array( 'comment_ID' => $comment_id, 'comment_content' => $content, @@ -355,7 +355,7 @@ public function update_comment( \WP_REST_Request $request ): \WP_REST_Response|\ return new \WP_Error( 'dws_ic_not_updated', __( 'The internal comment could not be updated. Please try again.', 'internal-comments' ), array( 'status' => 500 ) ); } - return $this->respond( null === $stored ? 0 : (int) $stored->comment_post_ID ); + return $this->respond( \is_null( $stored ) ? 0 : (int) $stored->comment_post_ID ); } /** @@ -371,7 +371,7 @@ public function update_comment( \WP_REST_Request $request ): \WP_REST_Response|\ public function trash_comment( \WP_REST_Request $request ): \WP_REST_Response|\WP_Error { $comment_id = absint( $request['id'] ); $stored = dws_ic_get_comment( $comment_id ); - $comment = null === $stored ? array() : $stored->to_array(); + $comment = \is_null( $stored ) ? array() : $stored->to_array(); /** * Fires before the meta box trashes an internal comment. @@ -398,7 +398,7 @@ public function trash_comment( \WP_REST_Request $request ): \WP_REST_Response|\W return new \WP_Error( 'dws_ic_not_trashed', __( 'The internal comment could not be moved to the trash. Please try again.', 'internal-comments' ), array( 'status' => 500 ) ); } - return $this->respond( null === $stored ? 0 : (int) $stored->comment_post_ID ); + return $this->respond( \is_null( $stored ) ? 0 : (int) $stored->comment_post_ID ); } // endregion diff --git a/plugins/linked-orders-for-woocommerce/includes/linking.php b/plugins/linked-orders-for-woocommerce/includes/linking.php index c8376a1..f589993 100644 --- a/plugins/linked-orders-for-woocommerce/includes/linking.php +++ b/plugins/linked-orders-for-woocommerce/includes/linking.php @@ -44,7 +44,7 @@ function dws_lowc_get_order_node( $order ): ?DWS_Order_Node { */ function dws_lowc_is_root_order( $order ): ?bool { $node = dws_lowc_get_order_node( $order ); - return null === $node ? null : 0 === $node->get_depth(); + return is_null( $node ) ? null : 0 === $node->get_depth(); } /** @@ -63,7 +63,7 @@ function dws_lowc_is_root_order( $order ): ?bool { function dws_lowc_link_orders( int $parent_id, int $child_id ): ?bool { $parent = dws_lowc_get_order_node( $parent_id ); $child = dws_lowc_get_order_node( $child_id ); - if ( null === $parent || null === $child ) { + if ( is_null( $parent ) || is_null( $child ) ) { return null; } @@ -114,7 +114,7 @@ function dws_lowc_link_orders( int $parent_id, int $child_id ): ?bool { */ function dws_lowc_get_root_order( $order ): ?DWS_Order_Node { $node = dws_lowc_get_order_node( $order ); - while ( null !== $node && $node->has_parent() ) { + while ( ! is_null( $node ) && $node->has_parent() ) { $node = $node->get_parent(); } @@ -133,7 +133,7 @@ function dws_lowc_get_root_order( $order ): ?DWS_Order_Node { */ function dws_lowc_get_orders_tree( $order ): ?array { $node = dws_lowc_get_order_node( $order ); - if ( null === $node ) { + if ( is_null( $node ) ) { return null; } diff --git a/plugins/linked-orders-for-woocommerce/includes/post-type.php b/plugins/linked-orders-for-woocommerce/includes/post-type.php index 0222c16..4f17b87 100644 --- a/plugins/linked-orders-for-woocommerce/includes/post-type.php +++ b/plugins/linked-orders-for-woocommerce/includes/post-type.php @@ -90,7 +90,7 @@ function dws_lowc_is_supported_order( $order ): ?bool { */ function dws_lowc_get_valid_statuses_for_new_child( string $order_type = 'shop_order', ?WC_Order $order = null ): array { $statuses = array_map( array( OrderUtil::class, 'remove_status_prefix' ), array_keys( wc_get_order_statuses() ) ); - $order_type = null === $order ? $order_type : $order->get_type(); + $order_type = is_null( $order ) ? $order_type : $order->get_type(); /** * Filters the statuses an order must have for a child to be created from it. diff --git a/plugins/linked-orders-for-woocommerce/includes/settings.php b/plugins/linked-orders-for-woocommerce/includes/settings.php index a3dc9e4..faf538f 100644 --- a/plugins/linked-orders-for-woocommerce/includes/settings.php +++ b/plugins/linked-orders-for-woocommerce/includes/settings.php @@ -33,7 +33,7 @@ */ function dws_lowc_get_raw_setting( string $field_id, ?string $group = null ) { $field = dws_lowc_find_setting( $field_id, $group ); - return null === $field ? null : get_option( $field[2], null ); + return is_null( $field ) ? null : get_option( $field[2], null ); } /** @@ -49,7 +49,7 @@ function dws_lowc_get_raw_setting( string $field_id, ?string $group = null ) { */ function dws_lowc_get_validated_setting( string $field_id, ?string $group = null ) { $field = dws_lowc_find_setting( $field_id, $group ); - if ( null === $field ) { + if ( is_null( $field ) ) { return null; } @@ -67,7 +67,7 @@ function dws_lowc_get_validated_setting( string $field_id, ?string $group = null * @param string $field_id The field's v1 id. */ $value = apply_filters_deprecated( "linked_orders_for_woocommerce/{$group_id}_settings/get_validated_option_value", array( $value, $id ), '2.0.0', 'dws_lowc/settings/validated_value' ); - if ( null === $group ) { + if ( is_null( $group ) ) { /** * Filters the validated value of a setting read through the section, after its group's filter. * @@ -108,7 +108,7 @@ function dws_lowc_get_validated_setting( string $field_id, ?string $group = null */ function dws_lowc_validate_setting( $value, string $field_id, ?string $group = null ) { $field = dws_lowc_find_setting( $field_id, $group ); - switch ( null === $field ? null : $field[2] ) { + switch ( is_null( $field ) ? null : $field[2] ) { case DWS_LOWC_OPTION_MAX_DEPTH: return max( filter_var( $value, FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE ) ?? 1, 1 ); case DWS_LOWC_OPTION_AUTOCOMPLETE: @@ -145,7 +145,7 @@ function dws_lowc_get_max_depth(): int { * @return array{0: string, 1: string, 2: string}|null */ function dws_lowc_find_setting( string $field_id, ?string $group ): ?array { - if ( null === $group ) { + if ( is_null( $group ) ) { if ( false === strpos( $field_id, '/' ) ) { return null; } diff --git a/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php b/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php index a4ef5b9..3c44745 100644 --- a/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php +++ b/plugins/linked-orders-for-woocommerce/models/DWS_Order_Node.php @@ -112,7 +112,7 @@ final class DWS_Order_Node { public function __construct( mixed $order ) { $order = wc_get_order( $order ); $post_type = $order instanceof WC_Order && true === dws_lowc_is_supported_order( $order ) ? get_post_type_object( $order->get_type() ) : null; - if ( ! $order instanceof WC_Order || null === $post_type ) { + if ( ! $order instanceof WC_Order || is_null( $post_type ) ) { throw new InvalidArgumentException( 'The order is missing or of an unsupported type.' ); } @@ -217,7 +217,7 @@ public function get_parent(): ?DWS_Order_Node { * @return bool */ public function has_parent(): bool { - return null !== $this->get_parent(); + return ! is_null( $this->get_parent() ); } /** diff --git a/plugins/linked-orders-for-woocommerce/src/Autocompletion.php b/plugins/linked-orders-for-woocommerce/src/Autocompletion.php index 3451ba1..961a2fa 100644 --- a/plugins/linked-orders-for-woocommerce/src/Autocompletion.php +++ b/plugins/linked-orders-for-woocommerce/src/Autocompletion.php @@ -68,7 +68,7 @@ public function complete_descendants( int $order_id ): void { * @param int $descendant_id The descendant's id. */ $node = true === apply_filters( 'dws_lowc/autocompletion/should_autocomplete', $should_autocomplete, $descendant_id ) ? dws_lowc_get_order_node( $descendant_id ) : null; - if ( null === $node ) { + if ( \is_null( $node ) ) { continue; } diff --git a/plugins/linked-orders-for-woocommerce/src/ChildCreation.php b/plugins/linked-orders-for-woocommerce/src/ChildCreation.php index 9f30fca..7544f4e 100644 --- a/plugins/linked-orders-for-woocommerce/src/ChildCreation.php +++ b/plugins/linked-orders-for-woocommerce/src/ChildCreation.php @@ -66,7 +66,7 @@ public function create_linked_child(): never { ) ) ?? 0; $node = dws_lowc_get_order_node( $parent_id ); - if ( null === $node ) { + if ( \is_null( $node ) ) { /* translators: %d: The parent order's id. */ $this->notices->add( new Notice( 'linked-child-missing-parent', esc_html( \sprintf( __( 'There is no order %d to create a linked child for.', 'linked-orders-for-woocommerce' ), $parent_id ) ) ) ); wp_safe_redirect( wp_get_referer() ?: admin_url( 'index.php' ) ); diff --git a/plugins/linked-orders-for-woocommerce/src/ListTable.php b/plugins/linked-orders-for-woocommerce/src/ListTable.php index 1c48077..2fc7890 100644 --- a/plugins/linked-orders-for-woocommerce/src/ListTable.php +++ b/plugins/linked-orders-for-woocommerce/src/ListTable.php @@ -49,7 +49,7 @@ public function register_hooks(): void { */ public function add_depth_column( \WP_Screen $screen ): void { $type = $this->can_see() ? self::get_list_type( $screen ) : null; - if ( null === $type ) { + if ( \is_null( $type ) ) { return; } @@ -112,7 +112,7 @@ public function insert_depth_column( array $columns ): array { */ public function render_depth_cell( string $column, mixed $post_or_order ): void { $node = 'dws_lo_depth' === $column ? dws_lowc_get_order_node( $post_or_order ) : null; - if ( null === $node ) { + if ( \is_null( $node ) ) { return; } @@ -157,7 +157,7 @@ public function render_depth_cell( string $column, mixed $post_or_order ): void */ public function render_filters( string $type ): void { $post_type = $this->can_see() && \in_array( $type, dws_lowc_get_supported_order_types(), true ) ? get_post_type_object( $type ) : null; - if ( null === $post_type ) { + if ( \is_null( $post_type ) ) { return; } @@ -208,7 +208,7 @@ public function filter_posts_query( array $query_vars ): array { $query_vars['meta_query'] = self::add_meta_clauses( $query_vars['meta_query'] ?? null, $clauses ); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- The filters are meta values. } $tree = self::get_tree_filter( $query_vars['post__in'] ?? null ); - if ( null !== $tree ) { + if ( ! \is_null( $tree ) ) { $query_vars['post__in'] = $tree; } @@ -241,7 +241,7 @@ public function filter_orders_query( array $args ): array { $args['meta_query'] = self::add_meta_clauses( $args['meta_query'] ?? null, $clauses ); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- The filters are meta values. } $tree = self::get_tree_filter( $args['id'] ?? null ); - if ( null !== $tree ) { + if ( ! \is_null( $tree ) ) { $args['id'] = $tree; } @@ -261,7 +261,7 @@ public function filter_orders_query( array $args ): array { */ public function add_row_actions( array $actions, \WC_Order $order ): array { $node = $this->can_see() ? dws_lowc_get_order_node( $order ) : null; - if ( null === $node ) { + if ( \is_null( $node ) ) { return $actions; } @@ -308,7 +308,7 @@ public function add_row_actions( array $actions, \WC_Order $order ): array { * @return void */ public function enqueue_assets(): void { - if ( ! $this->can_see() || null === self::get_list_type( get_current_screen() ) ) { + if ( ! $this->can_see() || \is_null( self::get_list_type( get_current_screen() ) ) ) { return; } @@ -349,7 +349,7 @@ protected function can_see(): bool { */ protected static function get_list_type( ?\WP_Screen $screen ): ?string { foreach ( dws_lowc_get_supported_order_types() as $type ) { - if ( null !== $screen && ( OrderUtil::custom_orders_table_usage_is_enabled() ? wc_get_page_screen_id( $type ) : "edit-$type" ) === $screen->id ) { + if ( ! \is_null( $screen ) && ( OrderUtil::custom_orders_table_usage_is_enabled() ? wc_get_page_screen_id( $type ) : "edit-$type" ) === $screen->id ) { return $type; } } @@ -407,7 +407,7 @@ protected static function get_depth_filter(): ?int { */ protected static function get_depth_clauses(): array { $depth = self::get_depth_filter(); - if ( null === $depth ) { + if ( \is_null( $depth ) ) { return array(); } @@ -459,7 +459,7 @@ protected static function get_tree_filter( mixed $found ): ?array { } $root = dws_lowc_get_root_order( $pivot ); - $tree = null === $root ? array() : dws_lowc_get_orders_tree( $root->get_order() ) ?? array(); + $tree = \is_null( $root ) ? array() : dws_lowc_get_orders_tree( $root->get_order() ) ?? array(); $found = \is_array( $found ) ? \filter_var( $found, \FILTER_VALIDATE_INT, \FILTER_REQUIRE_ARRAY | \FILTER_NULL_ON_FAILURE ) : null; if ( \is_array( $found ) && array() !== $found ) { $tree = \array_intersect( $tree, $found ); diff --git a/plugins/linked-orders-for-woocommerce/src/MetaBox.php b/plugins/linked-orders-for-woocommerce/src/MetaBox.php index 41e88c7..0ec43e0 100644 --- a/plugins/linked-orders-for-woocommerce/src/MetaBox.php +++ b/plugins/linked-orders-for-woocommerce/src/MetaBox.php @@ -43,7 +43,7 @@ public function register_hooks(): void { */ public function add_meta_box( string $screen_id, mixed $post_or_order ): void { $node = current_user_can( DWS_LOWC_CAP_SEE_ORDER_LINKS ) && current_user_can( DWS_LOWC_CAP_SEE_METABOX ) ? dws_lowc_get_order_node( $post_or_order ) : null; - if ( null === $node ) { + if ( \is_null( $node ) ) { return; } @@ -63,14 +63,14 @@ public function add_meta_box( string $screen_id, mixed $post_or_order ): void { */ public function render_meta_box( mixed $post_or_order ): void { $node = dws_lowc_get_order_node( $post_or_order ); - if ( null === $node ) { + if ( \is_null( $node ) ) { return; } $parent = $node->get_parent(); $can_create = $node->can_create_child(); $type_name = dws_lowc_get_singular_name( $node->get_post_type() ); - if ( null !== $parent ) { + if ( ! \is_null( $parent ) ) { ?>