*/ protected $messageTemplates = [ self::NOT_ARRAY => 'Expected an array value but %type% provided', ]; /** @var array */ protected $messageVariables = [ 'type' => 'type', ]; protected ?string $type = null; /** @var array */ protected $options = []; public function isValid(mixed $value): bool { if (is_array($value)) { return true; } $this->type = get_debug_type($value); $this->error(self::NOT_ARRAY); return false; } }