* * For the full copyright and license information, please view the "LICENSE.md" * file that was distributed with this source code. */ declare(strict_types=1); namespace Respect\Validation\Rules; use const FILTER_NULL_ON_FAILURE; use const FILTER_VALIDATE_BOOLEAN; use function filter_var; /** * Validates if a value is considered as true. * * @author Henrique Moody * @author Paul Karikari */ final class TrueVal extends AbstractRule { /** * {@inheritdoc} */ public function validate($input): bool { return true === filter_var($input, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); } }