PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.4
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.4
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / llms-txt / infrastructure / markdown-services / title-adapter.php

title-adapter.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.4, at src/llms-txt/infrastructure/markdown-services/title-adapter.php

44 lines 1009 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
4 namespace Yoast\WP\SEO\Llms_Txt\Infrastructure\Markdown_Services;
5
6 use Yoast\WP\SEO\Llms_Txt\Domain\Markdown\Sections\Title;
7 use Yoast\WP\SEO\Services\Health_Check\Default_Tagline_Runner;
8
9 /**
10 * The adapter of the title.
11 */
12 class Title_Adapter {
13
14 /**
15 * The default tagline runner.
16 *
17 * @var Default_Tagline_Runner
18 */
19 private $default_tagline_runner;
20
21 /**
22 * Class constructor.
23 *
24 * @param Default_Tagline_Runner $default_tagline_runner The default tagline runner.
25 */
26 public function __construct(
27 Default_Tagline_Runner $default_tagline_runner
28 ) {
29 $this->default_tagline_runner = $default_tagline_runner;
30 }
31
32 /**
33 * Gets the title.
34 *
35 * @return Title The title.
36 */
37 public function get_title(): Title {
38 $this->default_tagline_runner->run();
39 $tagline = ( $this->default_tagline_runner->is_successful() ? \get_bloginfo( 'description' ) : '' );
40
41 return new Title( \get_bloginfo( 'name' ), $tagline );
42 }
43 }
44