Skip to content

Commit

Permalink
Fix issues found by Psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Feb 19, 2024
1 parent 0f7b514 commit 89675f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/class-metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ public function init(): void {
add_filter( 'the_seo_framework_meta_render_data', [ $this, 'the_seo_framework_meta_render_data' ], PHP_INT_MAX );
}

/**
* @param mixed $title
* @psalm-param array{id?: int}|null $args
* @psalm-suppress RiskyTruthyFalsyComparison
*/
public function the_seo_framework_title_from_generation( $title, ?array $args ): string {
if ( null === $args && is_singular( 'criminal' ) ) {
$title = get_the_title();
} elseif ( null !== $args && ! empty( $args['id'] ) ) {
$title = get_the_title( $args['id'] );
}

return $title;
return (string) $title;
}

public function the_seo_framework_meta_render_data( array $data ): array {
Expand Down

0 comments on commit 89675f9

Please sign in to comment.