Skip to content

Commit

Permalink
Add Phpdoc to lag function
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Mar 4, 2024
1 parent a414c29 commit d473738
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
15 changes: 0 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Property DoctrineExtensions\\\\Query\\\\Mysql\\\\Lag\\:\\:\\$aggregateExpression \\(Doctrine\\\\ORM\\\\Query\\\\AST\\\\AggregateExpression\\) does not accept Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
path: src/Query/Mysql/Lag.php

-
message: "#^Property DoctrineExtensions\\\\Query\\\\Mysql\\\\Lag\\:\\:\\$defaultValue \\(Doctrine\\\\ORM\\\\Query\\\\AST\\\\SimpleArithmeticExpression\\) does not accept Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
path: src/Query/Mysql/Lag.php

-
message: "#^Property DoctrineExtensions\\\\Query\\\\Mysql\\\\Lag\\:\\:\\$offset \\(Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticExpression\\) does not accept Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
path: src/Query/Mysql/Lag.php

-
message: "#^Property DoctrineExtensions\\\\Query\\\\Mysql\\\\Lead\\:\\:\\$aggregateExpression \\(Doctrine\\\\ORM\\\\Query\\\\AST\\\\AggregateExpression\\) does not accept Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
Expand Down
16 changes: 8 additions & 8 deletions src/Query/Mysql/Lag.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\AggregateExpression;
use Doctrine\ORM\Query\AST\ArithmeticExpression;
use Doctrine\ORM\Query\AST;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

/**
* "LAG" "(" StringExpression ["," ArithmeticPrimary ["," ArithmeticPrimary]] ")"
* LagFunction ::= "LAG" "(" StringExpression ["," ArithmeticPrimary ["," SimpleArithmeticExpression ]] ")"
*
* @example SELECT LAG()
* @link https://dev.mysql.com/doc/refman/en/window-function-descriptions.html#function_lag
*
* @example {@see LagTest}
*/
class Lag extends FunctionNode
{
/** @var AggregateExpression */
/** @var AST\Subselect|AST\Node|string */
private $aggregateExpression;

/** @var ArithmeticExpression */
/** @var AST\Node|string */
private $offset;

/** @var SimpleArithmeticExpression */
/** @var AST\Node|string */
private $defaultValue;

public function getSql(SqlWalker $sqlWalker): string
Expand Down

0 comments on commit d473738

Please sign in to comment.