<?php

namespace Planaday\Utility\DataFilters\Validators;

class IsNeeded implements Validator {
	protected Needs $needs;

	public function __construct(Needs $needs) {
		$this->needs =& $needs;
	}

	public function validate( mixed $data ):string|bool {
		return true === $this->needs->validate( $data ) ? true : 'false';
	}

	public function getName(): string {
		return "is_needed";
	}
}