<?php
/**
 * Non-destructive report action.
 *
 * @package LocalGuardScanner
 */

namespace LocalGuardScanner\Domain\Response;

use LocalGuardScanner\Domain\Detection\Finding;

/**
 * The only enabled response action in version 1.
 */
final class ReportAction implements ResponseAction {
	/** @return string */
	public function id() {
		return 'report';
	}

	/** @param Finding $finding Finding. @return bool */
	public function supports( Finding $finding ): bool {
		return true;
	}

	/**
	 * Produce report metadata without modifying the site.
	 *
	 * @param Finding $finding Finding.
	 * @return array<string,bool|string>
	 */
	public function execute( Finding $finding ): array {
		return array(
			'action'   => 'report',
			'severity' => $finding->severity(),
			'modified' => false,
		);
	}
}
