Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORM3 compatibility #421

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"require": {
"php": "^7.2 || ^8.0",
derrabus marked this conversation as resolved.
Show resolved Hide resolved
"doctrine/orm": "^2.15"
"doctrine/orm": "^2.19 || ^3.0 @dev"
},
"require-dev": {
"doctrine/annotations": "^1.14 || ^2",
Expand Down
8 changes: 4 additions & 4 deletions src/Query/Mysql/Acos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class Acos extends FunctionNode
{
Expand All @@ -20,11 +20,11 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->arithmeticExpression = $parser->SimpleArithmeticExpression();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
10 changes: 5 additions & 5 deletions src/Query/Mysql/AddTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

/** @author Pascal Wacker <hello@pascalwacker.ch> */
class AddTime extends FunctionNode
Expand All @@ -21,15 +21,15 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->date = $parser->ArithmeticPrimary();

$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);

$this->time = $parser->ArithmeticPrimary();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
10 changes: 5 additions & 5 deletions src/Query/Mysql/AesDecrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

use function sprintf;

Expand All @@ -17,12 +17,12 @@ class AesDecrypt extends FunctionNode

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->field = $parser->StringExpression();
$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);
$this->key = $parser->StringExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}

public function getSql(SqlWalker $sqlWalker): string
Expand Down
10 changes: 5 additions & 5 deletions src/Query/Mysql/AesEncrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

use function sprintf;

Expand All @@ -17,12 +17,12 @@ class AesEncrypt extends FunctionNode

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->field = $parser->StringExpression();
$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);
$this->key = $parser->StringExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}

public function getSql(SqlWalker $sqlWalker): string
Expand Down
8 changes: 4 additions & 4 deletions src/Query/Mysql/AnyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

use function sprintf;

Expand All @@ -15,10 +15,10 @@ class AnyValue extends FunctionNode

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->value = $parser->StringPrimary();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}

public function getSql(SqlWalker $sqlWalker): string
Expand Down
8 changes: 4 additions & 4 deletions src/Query/Mysql/Ascii.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class Ascii extends FunctionNode
{
Expand All @@ -18,11 +18,11 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->string = $parser->ArithmeticExpression();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
8 changes: 4 additions & 4 deletions src/Query/Mysql/Asin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class Asin extends FunctionNode
{
Expand All @@ -20,11 +20,11 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->arithmeticExpression = $parser->SimpleArithmeticExpression();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
12 changes: 6 additions & 6 deletions src/Query/Mysql/Atan.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\QueryException;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class Atan extends FunctionNode
{
Expand All @@ -32,19 +32,19 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->arithmeticExpression = $parser->SimpleArithmeticExpression();

try {
$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);

$this->optionalSecondExpression = $parser->SimpleArithmeticExpression();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
} catch (QueryException $e) {
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
}
10 changes: 5 additions & 5 deletions src/Query/Mysql/Atan2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class Atan2 extends FunctionNode
{
Expand All @@ -28,15 +28,15 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->firstExpression = $parser->SimpleArithmeticExpression();

$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);

$this->secondExpression = $parser->SimpleArithmeticExpression();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
8 changes: 4 additions & 4 deletions src/Query/Mysql/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

/** @author Sarjono Mukti Aji <me@simukti.net> */
class Binary extends FunctionNode
Expand All @@ -14,12 +14,12 @@ class Binary extends FunctionNode

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->stringPrimary = $parser->StringPrimary();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}

public function getSql(SqlWalker $sqlWalker): string
Expand Down
8 changes: 4 additions & 4 deletions src/Query/Mysql/BitCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class BitCount extends FunctionNode
{
Expand All @@ -21,11 +21,11 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->arithmeticExpression = $parser->SimpleArithmeticExpression();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
10 changes: 5 additions & 5 deletions src/Query/Mysql/BitXor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace DoctrineExtensions\Query\Mysql;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

/**
* "BIT_XOR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
Expand All @@ -25,13 +25,13 @@ public function getSql(SqlWalker $sqlWalker): string

public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);

$this->firstArithmetic = $parser->ArithmeticPrimary();
$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);
$this->secondArithmetic = $parser->ArithmeticPrimary();

$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
Loading
Loading