Skip to content

Commit

Permalink
Add Phpdoc to CountIf
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Mar 1, 2024
1 parent 7fa7c31 commit 04033f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Query/Mysql/CountIf.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 @@ -11,16 +12,23 @@
use function strtolower;

/**
* "COUNTIF" "(" ArithmeticExpression "," ArithmeticExpression [ "," "INVERSE" ] ")"
* CountIfFunction ::= "COUNTIF" "(" ArithmeticExpression "," ArithmeticExpression [ "INVERSE" ] ")"
*
* @link https://dev.mysql.com/doc/refman/en/counting-rows.html
*
* @author Andrew Mackrodt <andrew@ajmm.org>
* @example SELECT COUNTIF(2, 3)
* @example SELECT COUNTIF(2, 3 INVERSE)
*/
class CountIf extends FunctionNode
{
/** @var ArithmeticExpression */
private $expr1;

/** @var ArithmeticExpression */
private $expr2;

/** @var bool */
private $inverse = false;

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

0 comments on commit 04033f5

Please sign in to comment.