<?php

namespace App\Modules\Shared\Domain\QueryBuilder\Operator;

class OperatorBetweenInvert implements Operator
{
    public function __construct(
        public Operator $value,
        public Operator $bottom,
        public Operator $top,
    ) {}

    public function query(): string
    {
        return "{$this->value->query()} BETWEEN {$this->bottom->query()} AND {$this->bottom->query()}";
    }

    public function values(): array
    {
        return [...$this->value->values(), ...$this->bottom->values(), ...$this->top->values()];
    }
}
