<?php
/**
 * Post scan item value object.
 *
 * @package Affilun\Application\Migration
 */

declare(strict_types=1);

namespace Affilun\Application\Migration;

/**
 * Immutable post slice consumed by migration / existing-post scans.
 */
final class PostScanItem {

	/**
	 * Post id.
	 */
	private int $id;

	/**
	 * Post title.
	 */
	private string $title;

	/**
	 * Post content.
	 */
	private string $content;

	/**
	 * @param int    $id      Post id.
	 * @param string $title   Post title.
	 * @param string $content Post content.
	 */
	public function __construct( int $id, string $title, string $content ) {
		$this->id      = $id;
		$this->title   = $title;
		$this->content = $content;
	}

	/**
	 * Return post id.
	 */
	public function id(): int {
		return $this->id;
	}

	/**
	 * Return post title.
	 */
	public function title(): string {
		return $this->title;
	}

	/**
	 * Return post content.
	 */
	public function content(): string {
		return $this->content;
	}

	/**
	 * Project for reports.
	 *
	 * @return array{id:int,title:string}
	 */
	public function summary(): array {
		return array(
			'id'    => $this->id,
			'title' => $this->title,
		);
	}
}
