HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/www/wp-content/plugins/wordpress-seo/src/ai/content-planner/domain/section.php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\AI\Content_Planner\Domain;

/**
 * Value object for a content outline section.
 */
class Section {

	/**
	 * The subheading text.
	 *
	 * @var string|null
	 */
	private $subheading_text;

	/**
	 * The content notes.
	 *
	 * @var array<string>
	 */
	private $content_notes;

	/**
	 * The constructor.
	 *
	 * @param array<string> $content_notes   The content notes.
	 * @param string|null   $subheading_text The subheading text.
	 */
	public function __construct( array $content_notes, ?string $subheading_text ) {
		$this->subheading_text = $subheading_text;
		$this->content_notes   = $content_notes;
	}

	/**
	 * Returns the subheading text.
	 *
	 * @return string|null The subheading text.
	 */
	public function get_subheading_text(): ?string {
		return $this->subheading_text;
	}

	/**
	 * Returns the content notes.
	 *
	 * @return array<string> The content notes.
	 */
	public function get_content_notes(): array {
		return $this->content_notes;
	}

	/**
	 * Returns this object in array format.
	 *
	 * @return array<string, string|array<string>|null> The section as an array.
	 */
	public function to_array(): array {
		return [
			'subheading_text' => $this->subheading_text,
			'content_notes'   => $this->content_notes,
		];
	}
}