Skip to content

Commit

Permalink
Add Phpdoc to Greatest
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Mar 1, 2024
1 parent d563c35 commit 3f1ce4d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Query/Mysql/Greatest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <phpvas@gmail.com>
* @author Guven Atbakan <guven@atbakan.com>
*
* @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<ArithmeticExpression> */
private $values;

public function parse(Parser $parser): void
{
Expand Down

0 comments on commit 3f1ce4d

Please sign in to comment.