PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.8
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.8
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 / task-list / domain / components / copy-set.php

copy-set.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.8, at src/task-list/domain/components/copy-set.php

60 lines 1.0 KB
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 -- Needed in the folder structure.
4 namespace Yoast\WP\SEO\Task_List\Domain\Components;
5
6 /**
7 * This class describes a set of copy.
8 */
9 class Copy_Set {
10
11 /**
12 * The title copy.
13 *
14 * @var string
15 */
16 private $title;
17
18 /**
19 * The about copy.
20 *
21 * @var string
22 */
23 private $about;
24
25 /**
26 * The constructor.
27 *
28 * @param string $title The title copy.
29 * @param string $about The about copy. Can contain HTML markup like <strong> and <p>.
30 */
31 public function __construct(
32 string $title,
33 string $about = ''
34 ) {
35 $this->title = $title;
36 $this->about = $about;
37 }
38
39 /**
40 * Returns the copy set's about.
41 *
42 * @return string
43 */
44 public function get_about(): string {
45 return $this->about;
46 }
47
48 /**
49 * Returns an array representation of the copy set data.
50 *
51 * @return array<string, string> Returns in an array format.
52 */
53 public function to_array(): array {
54 return [
55 'title' => $this->title,
56 'about' => $this->about,
57 ];
58 }
59 }
60