PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
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 / ai / content-planner / domain / section.php

section.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.5, at src/ai/content-planner/domain/section.php

65 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3 namespace Yoast\WP\SEO\AI\Content_Planner\Domain;
4
5 /**
6 * Value object for a content outline section.
7 */
8 class Section {
9
10 /**
11 * The subheading text.
12 *
13 * @var string|null
14 */
15 private $subheading_text;
16
17 /**
18 * The content notes.
19 *
20 * @var array<string>
21 */
22 private $content_notes;
23
24 /**
25 * The constructor.
26 *
27 * @param array<string> $content_notes The content notes.
28 * @param string|null $subheading_text The subheading text.
29 */
30 public function __construct( array $content_notes, ?string $subheading_text ) {
31 $this->subheading_text = $subheading_text;
32 $this->content_notes = $content_notes;
33 }
34
35 /**
36 * Returns the subheading text.
37 *
38 * @return string|null The subheading text.
39 */
40 public function get_subheading_text(): ?string {
41 return $this->subheading_text;
42 }
43
44 /**
45 * Returns the content notes.
46 *
47 * @return array<string> The content notes.
48 */
49 public function get_content_notes(): array {
50 return $this->content_notes;
51 }
52
53 /**
54 * Returns this object in array format.
55 *
56 * @return array<string, string|array<string>|null> The section as an array.
57 */
58 public function to_array(): array {
59 return [
60 'subheading_text' => $this->subheading_text,
61 'content_notes' => $this->content_notes,
62 ];
63 }
64 }
65