diff --git a/UPGRADE.md b/UPGRADE.md
index df40b151d24..a0a360d72d7 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -1,3 +1,9 @@
+# Upgrade to 2.19
+
+## Deprecate `Doctrine\ORM\Query\Lexer::T_*` constants
+
+Use `Doctrine\ORM\Query\TokenType::T_*` instead.
+
# Upgrade to 2.17
## Deprecate annotations classes for named queries
diff --git a/docs/en/cookbook/dql-user-defined-functions.rst b/docs/en/cookbook/dql-user-defined-functions.rst
index 9345a2535e9..b189ed59fcd 100644
--- a/docs/en/cookbook/dql-user-defined-functions.rst
+++ b/docs/en/cookbook/dql-user-defined-functions.rst
@@ -99,12 +99,12 @@ discuss it step by step:
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER); // (2)
- $parser->match(Lexer::T_OPEN_PARENTHESIS); // (3)
+ $parser->match(TokenType::T_IDENTIFIER); // (2)
+ $parser->match(TokenType::T_OPEN_PARENTHESIS); // (3)
$this->firstDateExpression = $parser->ArithmeticPrimary(); // (4)
- $parser->match(Lexer::T_COMMA); // (5)
+ $parser->match(TokenType::T_COMMA); // (5)
$this->secondDateExpression = $parser->ArithmeticPrimary(); // (6)
- $parser->match(Lexer::T_CLOSE_PARENTHESIS); // (3)
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS); // (3)
}
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
@@ -183,23 +183,23 @@ I'll skip the blah and show the code for this function:
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->firstDateExpression = $parser->ArithmeticPrimary();
- $parser->match(Lexer::T_COMMA);
- $parser->match(Lexer::T_IDENTIFIER);
+ $parser->match(TokenType::T_COMMA);
+ $parser->match(TokenType::T_IDENTIFIER);
$this->intervalExpression = $parser->ArithmeticPrimary();
- $parser->match(Lexer::T_IDENTIFIER);
+ $parser->match(TokenType::T_IDENTIFIER);
/** @var Lexer $lexer */
$lexer = $parser->getLexer();
$this->unit = $lexer->token['value'];
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst
index a9a7d6d3a1c..571190072e3 100644
--- a/docs/en/reference/dql-doctrine-query-language.rst
+++ b/docs/en/reference/dql-doctrine-query-language.rst
@@ -812,7 +812,7 @@ classes have to implement the base class :
namespace MyProject\Query\AST;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
- use Doctrine\ORM\Query\Lexer;
+ use Doctrine\ORM\Query\TokenType;
class MysqlFloor extends FunctionNode
{
@@ -827,12 +827,12 @@ classes have to implement the base class :
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 34b44307ff3..d2e890f17b5 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -2046,7 +2046,7 @@
$AST instanceof AST\SelectStatement
- $token === Lexer::T_IDENTIFIER
+ $token === TokenType::T_IDENTIFIER
diff --git a/src/Query/AST/Functions/AbsFunction.php b/src/Query/AST/Functions/AbsFunction.php
index c7c35a9dfda..5c0fd7fac15 100644
--- a/src/Query/AST/Functions/AbsFunction.php
+++ b/src/Query/AST/Functions/AbsFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "ABS" "(" SimpleArithmeticExpression ")"
@@ -30,11 +30,11 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/BitAndFunction.php b/src/Query/AST/Functions/BitAndFunction.php
index 93edf48ae59..c278de5e36e 100644
--- a/src/Query/AST/Functions/BitAndFunction.php
+++ b/src/Query/AST/Functions/BitAndFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "BIT_AND" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
@@ -36,13 +36,13 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $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);
}
}
diff --git a/src/Query/AST/Functions/BitOrFunction.php b/src/Query/AST/Functions/BitOrFunction.php
index 94fea1d8ea3..a380009cceb 100644
--- a/src/Query/AST/Functions/BitOrFunction.php
+++ b/src/Query/AST/Functions/BitOrFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "BIT_OR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
@@ -36,13 +36,13 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $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);
}
}
diff --git a/src/Query/AST/Functions/ConcatFunction.php b/src/Query/AST/Functions/ConcatFunction.php
index 8a67fbbb896..f25f0e69668 100644
--- a/src/Query/AST/Functions/ConcatFunction.php
+++ b/src/Query/AST/Functions/ConcatFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "CONCAT" "(" StringPrimary "," StringPrimary {"," StringPrimary }* ")"
@@ -42,22 +42,22 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->firstStringPrimary = $parser->StringPrimary();
$this->concatExpressions[] = $this->firstStringPrimary;
- $parser->match(Lexer::T_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->secondStringPrimary = $parser->StringPrimary();
$this->concatExpressions[] = $this->secondStringPrimary;
- while ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) {
- $parser->match(Lexer::T_COMMA);
+ while ($parser->getLexer()->isNextToken(TokenType::T_COMMA)) {
+ $parser->match(TokenType::T_COMMA);
$this->concatExpressions[] = $parser->StringPrimary();
}
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/CurrentDateFunction.php b/src/Query/AST/Functions/CurrentDateFunction.php
index ee7e733901c..c19c640c598 100644
--- a/src/Query/AST/Functions/CurrentDateFunction.php
+++ b/src/Query/AST/Functions/CurrentDateFunction.php
@@ -4,9 +4,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "CURRENT_DATE"
@@ -24,8 +24,8 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/CurrentTimeFunction.php b/src/Query/AST/Functions/CurrentTimeFunction.php
index e906cbe58eb..3595a0385d9 100644
--- a/src/Query/AST/Functions/CurrentTimeFunction.php
+++ b/src/Query/AST/Functions/CurrentTimeFunction.php
@@ -4,9 +4,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "CURRENT_TIME"
@@ -24,8 +24,8 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/CurrentTimestampFunction.php b/src/Query/AST/Functions/CurrentTimestampFunction.php
index 0bf1a801e25..349e32746df 100644
--- a/src/Query/AST/Functions/CurrentTimestampFunction.php
+++ b/src/Query/AST/Functions/CurrentTimestampFunction.php
@@ -4,9 +4,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "CURRENT_TIMESTAMP"
@@ -24,8 +24,8 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/DateAddFunction.php b/src/Query/AST/Functions/DateAddFunction.php
index efa7849e647..e980e8e8155 100644
--- a/src/Query/AST/Functions/DateAddFunction.php
+++ b/src/Query/AST/Functions/DateAddFunction.php
@@ -5,10 +5,10 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-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;
use function strtolower;
@@ -84,15 +84,15 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->firstDateExpression = $parser->ArithmeticPrimary();
- $parser->match(Lexer::T_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->intervalExpression = $parser->ArithmeticPrimary();
- $parser->match(Lexer::T_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->unit = $parser->StringPrimary();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/DateDiffFunction.php b/src/Query/AST/Functions/DateDiffFunction.php
index 181535265f4..209df00abd5 100644
--- a/src/Query/AST/Functions/DateDiffFunction.php
+++ b/src/Query/AST/Functions/DateDiffFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "DATE_DIFF" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
@@ -34,13 +34,13 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->date1 = $parser->ArithmeticPrimary();
- $parser->match(Lexer::T_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->date2 = $parser->ArithmeticPrimary();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/IdentityFunction.php b/src/Query/AST/Functions/IdentityFunction.php
index 10b8dc80582..e292c975afd 100644
--- a/src/Query/AST/Functions/IdentityFunction.php
+++ b/src/Query/AST/Functions/IdentityFunction.php
@@ -5,10 +5,10 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\PathExpression;
-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;
use function assert;
use function reset;
@@ -77,20 +77,20 @@ public function getSql(SqlWalker $sqlWalker)
*/
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->pathExpression = $parser->SingleValuedAssociationPathExpression();
- if ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) {
- $parser->match(Lexer::T_COMMA);
- $parser->match(Lexer::T_STRING);
+ if ($parser->getLexer()->isNextToken(TokenType::T_COMMA)) {
+ $parser->match(TokenType::T_COMMA);
+ $parser->match(TokenType::T_STRING);
$token = $parser->getLexer()->token;
assert($token !== null);
$this->fieldMapping = $token->value;
}
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/LengthFunction.php b/src/Query/AST/Functions/LengthFunction.php
index 29b603c2484..42420af54f0 100644
--- a/src/Query/AST/Functions/LengthFunction.php
+++ b/src/Query/AST/Functions/LengthFunction.php
@@ -8,9 +8,9 @@
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\AST\TypedExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "LENGTH" "(" StringPrimary ")"
@@ -33,12 +33,12 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $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 getReturnType(): Type
diff --git a/src/Query/AST/Functions/LocateFunction.php b/src/Query/AST/Functions/LocateFunction.php
index 20badbc91eb..2942f06107d 100644
--- a/src/Query/AST/Functions/LocateFunction.php
+++ b/src/Query/AST/Functions/LocateFunction.php
@@ -6,9 +6,9 @@
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")"
@@ -48,22 +48,22 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->firstStringPrimary = $parser->StringPrimary();
- $parser->match(Lexer::T_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->secondStringPrimary = $parser->StringPrimary();
$lexer = $parser->getLexer();
- if ($lexer->isNextToken(Lexer::T_COMMA)) {
- $parser->match(Lexer::T_COMMA);
+ if ($lexer->isNextToken(TokenType::T_COMMA)) {
+ $parser->match(TokenType::T_COMMA);
$this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression();
}
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/LowerFunction.php b/src/Query/AST/Functions/LowerFunction.php
index 0b7fcf83b88..e6c73cde4d9 100644
--- a/src/Query/AST/Functions/LowerFunction.php
+++ b/src/Query/AST/Functions/LowerFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
use function sprintf;
@@ -33,11 +33,11 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $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);
}
}
diff --git a/src/Query/AST/Functions/ModFunction.php b/src/Query/AST/Functions/ModFunction.php
index c0077d04080..ea6ee2e0d4e 100644
--- a/src/Query/AST/Functions/ModFunction.php
+++ b/src/Query/AST/Functions/ModFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
@@ -34,15 +34,15 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->firstSimpleArithmeticExpression = $parser->SimpleArithmeticExpression();
- $parser->match(Lexer::T_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->secondSimpleArithmeticExpression = $parser->SimpleArithmeticExpression();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/SizeFunction.php b/src/Query/AST/Functions/SizeFunction.php
index 70b7f6dadf3..4576f26d21f 100644
--- a/src/Query/AST/Functions/SizeFunction.php
+++ b/src/Query/AST/Functions/SizeFunction.php
@@ -6,9 +6,9 @@
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query\AST\PathExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
use function assert;
@@ -105,11 +105,11 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->collectionPathExpression = $parser->CollectionValuedPathExpression();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/SqrtFunction.php b/src/Query/AST/Functions/SqrtFunction.php
index 4e3a87015f9..a5cf3038768 100644
--- a/src/Query/AST/Functions/SqrtFunction.php
+++ b/src/Query/AST/Functions/SqrtFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
use function sprintf;
@@ -33,11 +33,11 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/SubstringFunction.php b/src/Query/AST/Functions/SubstringFunction.php
index 292248ea079..50031c7b361 100644
--- a/src/Query/AST/Functions/SubstringFunction.php
+++ b/src/Query/AST/Functions/SubstringFunction.php
@@ -6,9 +6,9 @@
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
/**
* "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
@@ -44,22 +44,22 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $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_COMMA);
+ $parser->match(TokenType::T_COMMA);
$this->firstSimpleArithmeticExpression = $parser->SimpleArithmeticExpression();
$lexer = $parser->getLexer();
- if ($lexer->isNextToken(Lexer::T_COMMA)) {
- $parser->match(Lexer::T_COMMA);
+ if ($lexer->isNextToken(TokenType::T_COMMA)) {
+ $parser->match(TokenType::T_COMMA);
$this->secondSimpleArithmeticExpression = $parser->SimpleArithmeticExpression();
}
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
}
diff --git a/src/Query/AST/Functions/TrimFunction.php b/src/Query/AST/Functions/TrimFunction.php
index 8c2b307faea..c2adeb121b9 100644
--- a/src/Query/AST/Functions/TrimFunction.php
+++ b/src/Query/AST/Functions/TrimFunction.php
@@ -6,9 +6,9 @@
use Doctrine\DBAL\Platforms\TrimMode;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
use function assert;
use function strcasecmp;
@@ -62,25 +62,25 @@ public function parse(Parser $parser)
{
$lexer = $parser->getLexer();
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
+ $parser->match(TokenType::T_IDENTIFIER);
+ $parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->parseTrimMode($parser);
- if ($lexer->isNextToken(Lexer::T_STRING)) {
- $parser->match(Lexer::T_STRING);
+ if ($lexer->isNextToken(TokenType::T_STRING)) {
+ $parser->match(TokenType::T_STRING);
assert($lexer->token !== null);
$this->trimChar = $lexer->token->value;
}
if ($this->leading || $this->trailing || $this->both || $this->trimChar) {
- $parser->match(Lexer::T_FROM);
+ $parser->match(TokenType::T_FROM);
}
$this->stringPrimary = $parser->StringPrimary();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
+ $parser->match(TokenType::T_CLOSE_PARENTHESIS);
}
/** @psalm-return TrimMode::* */
@@ -108,7 +108,7 @@ private function parseTrimMode(Parser $parser): void
$value = $lexer->lookahead->value;
if (strcasecmp('leading', $value) === 0) {
- $parser->match(Lexer::T_LEADING);
+ $parser->match(TokenType::T_LEADING);
$this->leading = true;
@@ -116,7 +116,7 @@ private function parseTrimMode(Parser $parser): void
}
if (strcasecmp('trailing', $value) === 0) {
- $parser->match(Lexer::T_TRAILING);
+ $parser->match(TokenType::T_TRAILING);
$this->trailing = true;
@@ -124,7 +124,7 @@ private function parseTrimMode(Parser $parser): void
}
if (strcasecmp('both', $value) === 0) {
- $parser->match(Lexer::T_BOTH);
+ $parser->match(TokenType::T_BOTH);
$this->both = true;
diff --git a/src/Query/AST/Functions/UpperFunction.php b/src/Query/AST/Functions/UpperFunction.php
index d896c5af7f7..15273973f98 100644
--- a/src/Query/AST/Functions/UpperFunction.php
+++ b/src/Query/AST/Functions/UpperFunction.php
@@ -5,9 +5,9 @@
namespace Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\AST\Node;
-use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
+use Doctrine\ORM\Query\TokenType;
use function sprintf;
@@ -33,11 +33,11 @@ public function getSql(SqlWalker $sqlWalker)
/** @inheritDoc */
public function parse(Parser $parser)
{
- $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);
}
}
diff --git a/src/Query/Lexer.php b/src/Query/Lexer.php
index da68a6c6c1a..d4f0aefc255 100644
--- a/src/Query/Lexer.php
+++ b/src/Query/Lexer.php
@@ -21,95 +21,249 @@
/**
* Scans a DQL query for tokens.
*
- * @extends AbstractLexer
+ * @extends AbstractLexer
*/
class Lexer extends AbstractLexer
{
// All tokens that are not valid identifiers must be < 100
- public const T_NONE = 1;
- public const T_INTEGER = 2;
- public const T_STRING = 3;
- public const T_INPUT_PARAMETER = 4;
- public const T_FLOAT = 5;
- public const T_CLOSE_PARENTHESIS = 6;
- public const T_OPEN_PARENTHESIS = 7;
- public const T_COMMA = 8;
- public const T_DIVIDE = 9;
- public const T_DOT = 10;
- public const T_EQUALS = 11;
- public const T_GREATER_THAN = 12;
- public const T_LOWER_THAN = 13;
- public const T_MINUS = 14;
- public const T_MULTIPLY = 15;
- public const T_NEGATE = 16;
- public const T_PLUS = 17;
- public const T_OPEN_CURLY_BRACE = 18;
- public const T_CLOSE_CURLY_BRACE = 19;
+ /** @deprecated use {@see TokenType::T_NONE} */
+ public const T_NONE = TokenType::T_NONE;
+
+ /** @deprecated use {@see TokenType::T_INTEGER} */
+ public const T_INTEGER = TokenType::T_INTEGER;
+
+ /** @deprecated use {@see TokenType::T_STRING} */
+ public const T_STRING = TokenType::T_STRING;
+
+ /** @deprecated use {@see TokenType::T_INPUT_PARAMETER} */
+ public const T_INPUT_PARAMETER = TokenType::T_INPUT_PARAMETER;
+
+ /** @deprecated use {@see TokenType::T_FLOAT} */
+ public const T_FLOAT = TokenType::T_FLOAT;
+
+ /** @deprecated use {@see TokenType::T_CLOSE_PARENTHESIS} */
+ public const T_CLOSE_PARENTHESIS = TokenType::T_CLOSE_PARENTHESIS;
+
+ /** @deprecated use {@see TokenType::T_OPEN_PARENTHESIS} */
+ public const T_OPEN_PARENTHESIS = TokenType::T_OPEN_PARENTHESIS;
+
+ /** @deprecated use {@see TokenType::T_COMMA} */
+ public const T_COMMA = TokenType::T_COMMA;
+
+ /** @deprecated use {@see TokenType::T_DIVIDE} */
+ public const T_DIVIDE = TokenType::T_DIVIDE;
+
+ /** @deprecated use {@see TokenType::T_DOT} */
+ public const T_DOT = TokenType::T_DOT;
+
+ /** @deprecated use {@see TokenType::T_EQUALS} */
+ public const T_EQUALS = TokenType::T_EQUALS;
+
+ /** @deprecated use {@see TokenType::T_GREATER_THAN} */
+ public const T_GREATER_THAN = TokenType::T_GREATER_THAN;
+
+ /** @deprecated use {@see TokenType::T_LOWER_THAN} */
+ public const T_LOWER_THAN = TokenType::T_LOWER_THAN;
+
+ /** @deprecated use {@see TokenType::T_MINUS} */
+ public const T_MINUS = TokenType::T_MINUS;
+
+ /** @deprecated use {@see TokenType::T_MULTIPLY} */
+ public const T_MULTIPLY = TokenType::T_MULTIPLY;
+
+ /** @deprecated use {@see TokenType::T_NEGATE} */
+ public const T_NEGATE = TokenType::T_NEGATE;
+
+ /** @deprecated use {@see TokenType::T_PLUS} */
+ public const T_PLUS = TokenType::T_PLUS;
+
+ /** @deprecated use {@see TokenType::T_OPEN_CURLY_BRACE} */
+ public const T_OPEN_CURLY_BRACE = TokenType::T_OPEN_CURLY_BRACE;
+
+ /** @deprecated use {@see TokenType::T_CLOSE_CURLY_BRACE} */
+ public const T_CLOSE_CURLY_BRACE = TokenType::T_CLOSE_CURLY_BRACE;
// All tokens that are identifiers or keywords that could be considered as identifiers should be >= 100
/** @deprecated No Replacement planned. */
- public const T_ALIASED_NAME = 100;
- public const T_FULLY_QUALIFIED_NAME = 101;
- public const T_IDENTIFIER = 102;
+ public const T_ALIASED_NAME = TokenType::T_ALIASED_NAME;
+
+ /** @deprecated use {@see TokenType::T_FULLY_QUALIFIED_NAME} */
+ public const T_FULLY_QUALIFIED_NAME = TokenType::T_FULLY_QUALIFIED_NAME;
+
+ /** @deprecated use {@see TokenType::T_IDENTIFIER} */
+ public const T_IDENTIFIER = TokenType::T_IDENTIFIER;
// All keyword tokens should be >= 200
- public const T_ALL = 200;
- public const T_AND = 201;
- public const T_ANY = 202;
- public const T_AS = 203;
- public const T_ASC = 204;
- public const T_AVG = 205;
- public const T_BETWEEN = 206;
- public const T_BOTH = 207;
- public const T_BY = 208;
- public const T_CASE = 209;
- public const T_COALESCE = 210;
- public const T_COUNT = 211;
- public const T_DELETE = 212;
- public const T_DESC = 213;
- public const T_DISTINCT = 214;
- public const T_ELSE = 215;
- public const T_EMPTY = 216;
- public const T_END = 217;
- public const T_ESCAPE = 218;
- public const T_EXISTS = 219;
- public const T_FALSE = 220;
- public const T_FROM = 221;
- public const T_GROUP = 222;
- public const T_HAVING = 223;
- public const T_HIDDEN = 224;
- public const T_IN = 225;
- public const T_INDEX = 226;
- public const T_INNER = 227;
- public const T_INSTANCE = 228;
- public const T_IS = 229;
- public const T_JOIN = 230;
- public const T_LEADING = 231;
- public const T_LEFT = 232;
- public const T_LIKE = 233;
- public const T_MAX = 234;
- public const T_MEMBER = 235;
- public const T_MIN = 236;
- public const T_NEW = 237;
- public const T_NOT = 238;
- public const T_NULL = 239;
- public const T_NULLIF = 240;
- public const T_OF = 241;
- public const T_OR = 242;
- public const T_ORDER = 243;
- public const T_OUTER = 244;
- public const T_PARTIAL = 245;
- public const T_SELECT = 246;
- public const T_SET = 247;
- public const T_SOME = 248;
- public const T_SUM = 249;
- public const T_THEN = 250;
- public const T_TRAILING = 251;
- public const T_TRUE = 252;
- public const T_UPDATE = 253;
- public const T_WHEN = 254;
- public const T_WHERE = 255;
- public const T_WITH = 256;
+ /** @deprecated use {@see TokenType::T_ALL} */
+ public const T_ALL = TokenType::T_ALL;
+
+ /** @deprecated use {@see TokenType::T_AND} */
+ public const T_AND = TokenType::T_AND;
+
+ /** @deprecated use {@see TokenType::T_ANY} */
+ public const T_ANY = TokenType::T_ANY;
+
+ /** @deprecated use {@see TokenType::T_AS} */
+ public const T_AS = TokenType::T_AS;
+
+ /** @deprecated use {@see TokenType::T_ASC} */
+ public const T_ASC = TokenType::T_ASC;
+
+ /** @deprecated use {@see TokenType::T_AVG} */
+ public const T_AVG = TokenType::T_AVG;
+
+ /** @deprecated use {@see TokenType::T_BETWEEN} */
+ public const T_BETWEEN = TokenType::T_BETWEEN;
+
+ /** @deprecated use {@see TokenType::T_BOTH} */
+ public const T_BOTH = TokenType::T_BOTH;
+
+ /** @deprecated use {@see TokenType::T_BY} */
+ public const T_BY = TokenType::T_BY;
+
+ /** @deprecated use {@see TokenType::T_CASE} */
+ public const T_CASE = TokenType::T_CASE;
+
+ /** @deprecated use {@see TokenType::T_COALESCE} */
+ public const T_COALESCE = TokenType::T_COALESCE;
+
+ /** @deprecated use {@see TokenType::T_COUNT} */
+ public const T_COUNT = TokenType::T_COUNT;
+
+ /** @deprecated use {@see TokenType::T_DELETE} */
+ public const T_DELETE = TokenType::T_DELETE;
+
+ /** @deprecated use {@see TokenType::T_DESC} */
+ public const T_DESC = TokenType::T_DESC;
+
+ /** @deprecated use {@see TokenType::T_DISTINCT} */
+ public const T_DISTINCT = TokenType::T_DISTINCT;
+
+ /** @deprecated use {@see TokenType::T_ELSE} */
+ public const T_ELSE = TokenType::T_ELSE;
+
+ /** @deprecated use {@see TokenType::T_EMPTY} */
+ public const T_EMPTY = TokenType::T_EMPTY;
+
+ /** @deprecated use {@see TokenType::T_END} */
+ public const T_END = TokenType::T_END;
+
+ /** @deprecated use {@see TokenType::T_ESCAPE} */
+ public const T_ESCAPE = TokenType::T_ESCAPE;
+
+ /** @deprecated use {@see TokenType::T_EXISTS} */
+ public const T_EXISTS = TokenType::T_EXISTS;
+
+ /** @deprecated use {@see TokenType::T_FALSE} */
+ public const T_FALSE = TokenType::T_FALSE;
+
+ /** @deprecated use {@see TokenType::T_FROM} */
+ public const T_FROM = TokenType::T_FROM;
+
+ /** @deprecated use {@see TokenType::T_GROUP} */
+ public const T_GROUP = TokenType::T_GROUP;
+
+ /** @deprecated use {@see TokenType::T_HAVING} */
+ public const T_HAVING = TokenType::T_HAVING;
+
+ /** @deprecated use {@see TokenType::T_HIDDEN} */
+ public const T_HIDDEN = TokenType::T_HIDDEN;
+
+ /** @deprecated use {@see TokenType::T_IN} */
+ public const T_IN = TokenType::T_IN;
+
+ /** @deprecated use {@see TokenType::T_INDEX} */
+ public const T_INDEX = TokenType::T_INDEX;
+
+ /** @deprecated use {@see TokenType::T_INNER} */
+ public const T_INNER = TokenType::T_INNER;
+
+ /** @deprecated use {@see TokenType::T_INSTANCE} */
+ public const T_INSTANCE = TokenType::T_INSTANCE;
+
+ /** @deprecated use {@see TokenType::T_IS} */
+ public const T_IS = TokenType::T_IS;
+
+ /** @deprecated use {@see TokenType::T_JOIN} */
+ public const T_JOIN = TokenType::T_JOIN;
+
+ /** @deprecated use {@see TokenType::T_LEADING} */
+ public const T_LEADING = TokenType::T_LEADING;
+
+ /** @deprecated use {@see TokenType::T_LEFT} */
+ public const T_LEFT = TokenType::T_LEFT;
+
+ /** @deprecated use {@see TokenType::T_LIKE} */
+ public const T_LIKE = TokenType::T_LIKE;
+
+ /** @deprecated use {@see TokenType::T_MAX} */
+ public const T_MAX = TokenType::T_MAX;
+
+ /** @deprecated use {@see TokenType::T_MEMBER} */
+ public const T_MEMBER = TokenType::T_MEMBER;
+
+ /** @deprecated use {@see TokenType::T_MIN} */
+ public const T_MIN = TokenType::T_MIN;
+
+ /** @deprecated use {@see TokenType::T_NEW} */
+ public const T_NEW = TokenType::T_NEW;
+
+ /** @deprecated use {@see TokenType::T_NOT} */
+ public const T_NOT = TokenType::T_NOT;
+
+ /** @deprecated use {@see TokenType::T_NULL} */
+ public const T_NULL = TokenType::T_NULL;
+
+ /** @deprecated use {@see TokenType::T_NULLIF} */
+ public const T_NULLIF = TokenType::T_NULLIF;
+
+ /** @deprecated use {@see TokenType::T_OF} */
+ public const T_OF = TokenType::T_OF;
+
+ /** @deprecated use {@see TokenType::T_OR} */
+ public const T_OR = TokenType::T_OR;
+
+ /** @deprecated use {@see TokenType::T_ORDER} */
+ public const T_ORDER = TokenType::T_ORDER;
+
+ /** @deprecated use {@see TokenType::T_OUTER} */
+ public const T_OUTER = TokenType::T_OUTER;
+
+ /** @deprecated use {@see TokenType::T_PARTIAL} */
+ public const T_PARTIAL = TokenType::T_PARTIAL;
+
+ /** @deprecated use {@see TokenType::T_SELECT} */
+ public const T_SELECT = TokenType::T_SELECT;
+
+ /** @deprecated use {@see TokenType::T_SET} */
+ public const T_SET = TokenType::T_SET;
+
+ /** @deprecated use {@see TokenType::T_SOME} */
+ public const T_SOME = TokenType::T_SOME;
+
+ /** @deprecated use {@see TokenType::T_SUM} */
+ public const T_SUM = TokenType::T_SUM;
+
+ /** @deprecated use {@see TokenType::T_THEN} */
+ public const T_THEN = TokenType::T_THEN;
+
+ /** @deprecated use {@see TokenType::T_TRAILING} */
+ public const T_TRAILING = TokenType::T_TRAILING;
+
+ /** @deprecated use {@see TokenType::T_TRUE} */
+ public const T_TRUE = TokenType::T_TRUE;
+
+ /** @deprecated use {@see TokenType::T_UPDATE} */
+ public const T_UPDATE = TokenType::T_UPDATE;
+
+ /** @deprecated use {@see TokenType::T_WHEN} */
+ public const T_WHEN = TokenType::T_WHEN;
+
+ /** @deprecated use {@see TokenType::T_WHERE} */
+ public const T_WHERE = TokenType::T_WHERE;
+
+ /** @deprecated use {@see TokenType::T_WITH} */
+ public const T_WITH = TokenType::T_WITH;
/**
* Creates a new query scanner object.
@@ -169,7 +323,7 @@ protected function getType(&$value)
// Recognize identifiers, aliased or qualified names
case ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\':
- $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value);
+ $name = 'Doctrine\ORM\Query\TokenType::T_' . strtoupper($value);
if (defined($name)) {
$type = constant($name);
diff --git a/src/Query/Parser.php b/src/Query/Parser.php
index 7e69b4865d0..949a8f4ebdd 100644
--- a/src/Query/Parser.php
+++ b/src/Query/Parser.php
@@ -36,7 +36,7 @@
* Parses a DQL query, reports any errors in it, and generates an AST.
*
* @psalm-import-type AssociationMapping from ClassMetadata
- * @psalm-type DqlToken = Token
+ * @psalm-type DqlToken = Token
* @psalm-type QueryComponent = array{
* metadata?: ClassMetadata