for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SolBianca\Validator\Rules;
use SolBianca\Validator\Interfaces\RuleInterface;
class BetweenRule implements RuleInterface
{
/**
* {@inheritdoc}
*/
public function run($value, array $input, array $args): bool
if (!is_numeric($value)) {
return false;
}
return ($value >= $args[0] && $value <= $args[1]) ? true : false;
public function errorMessage(): string
return 'Field `{field}` must be between `{$0}` and `{$1}``.';
public function canSkip(): bool
return true;