diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index a65faffc..ed9564b1 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -2,6 +2,7 @@ namespace DoctrineExtensions\Query\Mysql; +use Doctrine\ORM\Query\AST\ArithmeticExpression; use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; @@ -10,16 +11,24 @@ use function count; /** - * "GREATEST" "(" ? ")" + * GreatestFunction ::= "GREATEST" "(" ArithmeticExpression "," ArithmeticExpression [{ "," ArithmeticExpression }*] ")" + * + * @link https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html#function_greatest * * @author Vas N * @author Guven Atbakan + * + * @example SELECT(1, 2) + * @example SELECT(1, 2, 100, 10) + * @example SELECT(foo.bar, foo.bar2) FROM entity */ class Greatest extends FunctionNode { + /** @var ArithmeticExpression */ private $field = null; - private $values = []; + /** @var non-empty-array */ + private $values; public function parse(Parser $parser): void {