diff --git a/inc/Modules/Core/Assets.php b/inc/Modules/Core/Assets.php index 2458059..84ca819 100644 --- a/inc/Modules/Core/Assets.php +++ b/inc/Modules/Core/Assets.php @@ -134,10 +134,8 @@ public function register_assets(): void { /** * Add scripts and styles to the page. - * - * @param string $hook_suffix Admin page name. */ - public function enqueue_scripts( $hook_suffix ): void { + public function enqueue_scripts(): void { // @todo Only enqueue on OneSearch admin pages. wp_enqueue_style( self::ADMIN_STYLES_HANDLE ); } diff --git a/inc/Modules/Rest/Governing_Data_Controller.php b/inc/Modules/Rest/Governing_Data_Controller.php index 8f286c8..56a17f1 100644 --- a/inc/Modules/Rest/Governing_Data_Controller.php +++ b/inc/Modules/Rest/Governing_Data_Controller.php @@ -1,13 +1,12 @@ post_content ); } catch ( \Throwable $e ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- @todo Surface this better with a Logger class. diff --git a/inc/Modules/Search/Search.php b/inc/Modules/Search/Search.php index 344072e..1f78c26 100644 --- a/inc/Modules/Search/Search.php +++ b/inc/Modules/Search/Search.php @@ -56,7 +56,7 @@ public function register_hooks(): void { // Author data. add_filter( 'get_the_author_display_name', [ $this, 'get_post_author' ], 10 ); - add_filter( 'author_link', [ $this, 'get_post_author_link' ], 10, 3 ); + add_filter( 'author_link', [ $this, 'get_post_author_link' ], 10 ); add_filter( 'get_avatar_url', [ $this, 'get_post_author_avatar' ], 10 ); // Term and taxonomy link handling for remote objects. @@ -67,7 +67,7 @@ public function register_hooks(): void { add_filter( 'wp_get_post_terms', [ $this, 'get_post_terms' ], 10, 3 ); // Block-theme compatibility: fix remote permalinks/excerpts in rendered blocks. - add_filter( 'render_block', [ $this, 'filter_render_block' ], 10, 3 ); + add_filter( 'render_block', [ $this, 'filter_render_block' ], 10, 2 ); } /** @@ -166,13 +166,11 @@ public function get_post_author( $author_name ) { /** * Author link mapping for remote posts. * - * @param string $author_link Default author link. - * @param int $author_id Author ID (negative for remote). - * @param string|null $author_nicename The author's nicename if provided by the filter. + * @param string $author_link Default author link. * * @return string */ - public function get_post_author_link( $author_link, $author_id, $author_nicename = null ) { + public function get_post_author_link( $author_link ) { global $wp_query, $post; if ( ! $this->is_search_enabled() || ! $wp_query instanceof \WP_Query || ! $this->should_filter_query( $wp_query ) ) { @@ -325,11 +323,10 @@ public function get_post_terms( $terms, $post_id, $taxonomy ) { * * @param string $block_content Rendered block HTML. * @param array $block Block data. - * @param \WP_Block $instance Block instance. * * @return string */ - public function filter_render_block( $block_content, $block, $instance ) { + public function filter_render_block( $block_content, $block ) { global $post; if ( ! $this->is_search_enabled() || ! $post instanceof \WP_Post || (int) $post->ID >= 0 || empty( $post->guid ) ) { diff --git a/inc/Modules/Search/Settings.php b/inc/Modules/Search/Settings.php index f17c1c7..138e349 100644 --- a/inc/Modules/Search/Settings.php +++ b/inc/Modules/Search/Settings.php @@ -166,10 +166,12 @@ public function register_settings(): void { /** * Deletes Algolia index when site type is changed to consumer. * + * @internal Hook callback + * * @param mixed $old_value The old value. * @param mixed $new_value The new value. */ - public function on_site_type_change( $old_value, $new_value ): void { + public function on_site_type_change( $old_value, $new_value ): void { // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter if ( Admin_Settings::SITE_TYPE_CONSUMER !== $new_value ) { return; } @@ -252,11 +254,13 @@ static function ( $site_url ) { /** * Purges the Governing_Data_Handler cache when a setting update triggers. * + * @internal Hook callback + * * @param mixed $old_value The old value. * @param mixed $new_value The new value. * @param string $option The option name. */ - public function purge_cache_on_update( $old_value, $new_value, $option ): void { + public function purge_cache_on_update( $old_value, $new_value, $option ): void { // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter match ( $option ) { self::OPTION_GOVERNING_ALGOLIA_CREDENTIALS, self::OPTION_GOVERNING_SEARCH_SETTINGS, diff --git a/inc/Modules/Search/Watcher.php b/inc/Modules/Search/Watcher.php index 2ff498c..eb3c295 100644 --- a/inc/Modules/Search/Watcher.php +++ b/inc/Modules/Search/Watcher.php @@ -29,11 +29,13 @@ public function register_hooks(): void { /** * Triggered when a post's status changes (e.g., publish, update, trash, etc.) * + * @internal Hook callback + * * @param string $new_status The new post status. * @param string $old_status The previous post status. * @param \WP_Post $post The post object. */ - public function on_post_transition( $new_status, $old_status, $post ): void { + public function on_post_transition( $new_status, $old_status, $post ): void { // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter if ( ! $post instanceof \WP_Post || ! $this->is_post_type_indexable( (string) $post->post_type ) ) { return; } diff --git a/inc/Modules/Settings/Settings.php b/inc/Modules/Settings/Settings.php index 581048e..8c1a5ec 100644 --- a/inc/Modules/Settings/Settings.php +++ b/inc/Modules/Settings/Settings.php @@ -165,10 +165,12 @@ public function register_settings(): void { /** * Ensures the API key is generated when the site type changes to 'consumer'. * + * @internal Hook callback + * * @param mixed $old_value The old value. * @param mixed $new_value The new value. */ - public function on_site_type_change( $old_value, $new_value ): void { + public function on_site_type_change( $old_value, $new_value ): void { // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter if ( self::SITE_TYPE_CONSUMER !== $new_value ) { return; }