<?php
use Laminas\Validator\ValidatorChain;
use Laminas\Validator\NotEmpty;
use Laminas\Validator\Between;
$chain = new ValidatorChain();
$chain->attach(new NotEmpty());
$chain->attach(new Between([
'min' => 3,
'max' => 9,
]));
dump($chain->isValid(''));
dump($chain->getMessages());
dump($chain->isValid(1));
dump($chain->getMessages());
dump($chain->isValid(5));
dump($chain->getMessages());
^ false
^ array:2 [ "isEmpty" => "Value is required and can't be empty" "valueNotNumeric" => "The min ('3') and max ('9') values are numeric, but the input is not" ]
^ false
^ array:1 [ "notBetween" => "The input is not between '3' and '9', inclusively" ]
^ true
^ []