| 1 |
<?php |
| 2 |
|
| 3 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong |
| 4 |
namespace Yoast\WP\SEO\Llms_Txt\Application\Markdown_Builders; |
| 5 |
|
| 6 |
use Yoast\WP\SEO\Llms_Txt\Domain\Markdown\Sections\Title; |
| 7 |
use Yoast\WP\SEO\Llms_Txt\Infrastructure\Markdown_Services\Title_Adapter; |
| 8 |
|
| 9 |
/** |
| 10 |
* The builder of the title section. |
| 11 |
*/ |
| 12 |
class Title_Builder { |
| 13 |
|
| 14 |
/** |
| 15 |
* The title adapter. |
| 16 |
* |
| 17 |
* @var Title_Adapter |
| 18 |
*/ |
| 19 |
protected $title_adapter; |
| 20 |
|
| 21 |
/** |
| 22 |
* The constructor. |
| 23 |
* |
| 24 |
* @param Title_Adapter $title_adapter The title adapter. |
| 25 |
*/ |
| 26 |
public function __construct( |
| 27 |
Title_Adapter $title_adapter |
| 28 |
) { |
| 29 |
$this->title_adapter = $title_adapter; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Builds the title section. |
| 34 |
* |
| 35 |
* @return Title The title section. |
| 36 |
*/ |
| 37 |
public function build_title(): Title { |
| 38 |
return $this->title_adapter->get_title(); |
| 39 |
} |
| 40 |
} |
| 41 |
|