<?php
/**
 * Filesystem batch result.
 *
 * @package LocalGuardScanner
 */

namespace LocalGuardScanner\Detection\Filesystem;

/**
 * Contains discovered files and a resumable cursor.
 */
final class FileBatch {
	/** @var FileInventoryItem[] */
	private $items;
	/** @var array<string,mixed> */
	private $cursor;
	/** @var bool */
	private $done;
	/** @var array<string,int> */
	private $omissions;

	/**
	 * @param FileInventoryItem[] $items  Files.
	 * @param array<string,mixed> $cursor Cursor.
	 * @param bool                $done      Completion flag.
	 * @param array<string,int>   $omissions Coverage omissions.
	 */
	public function __construct( array $items, array $cursor, $done, array $omissions = array() ) {
		$this->items     = $items;
		$this->cursor    = $cursor;
		$this->done      = (bool) $done;
		$this->omissions = $omissions;
	}

	/** @return FileInventoryItem[] */
	public function items() {
		return $this->items;
	}

	/** @return array<string,mixed> */
	public function cursor() {
		return $this->cursor;
	}

	/** @return bool */
	public function done() {
		return $this->done;
	}

	/** @return array<string,int> */
	public function omissions() {
		return $this->omissions;
	}
}
