HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: //home/pelakir/www/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,
		];
	}
}