HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: /var/www/html/wp-content/plugins/wordpress-seo/src/ai/content-planner/domain/category.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 Post Category.
 */
class Category {

	/**
	 * The name.
	 *
	 * @var string
	 */
	private $name;

	/**
	 * The ID.
	 *
	 * @var int
	 */
	private $id;

	/**
	 * The constructor.
	 *
	 * @param string $name The category title.
	 * @param int    $id   The category ID.
	 */
	public function __construct( string $name, int $id ) {
		$this->name = $name;
		$this->id   = $id;
	}

	/**
	 * Returns this object in array format.
	 *
	 * @return array<string,int>
	 */
	public function to_array(): array {
		return [
			'name' => $this->name,
			'id'   => $this->id,
		];
	}
}