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

Migrate Parser to PHP 8 #10506

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 2 additions & 5 deletions lib/Doctrine/ORM/Query/AST/AggregateExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@

class AggregateExpression extends Node
{
/**
* @param PathExpression|SimpleArithmeticExpression $pathExpression
* @param bool $isDistinct Some aggregate expressions support distinct, eg COUNT.
*/
/** @param bool $isDistinct Some aggregate expressions support distinct, eg COUNT. */
public function __construct(
public string $functionName,
public $pathExpression,
public Node|string $pathExpression,
public bool $isDistinct,
) {
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*/
class ArithmeticExpression extends Node
{
/** @var SimpleArithmeticExpression|null */
public $simpleArithmeticExpression;
public Node|string|null $simpleArithmeticExpression = null;

/** @var Subselect|null */
public $subselect;
Expand Down
5 changes: 2 additions & 3 deletions lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\ORM\Query\AST\Functions;

use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;
Expand All @@ -16,8 +16,7 @@
*/
class AbsFunction extends FunctionNode
{
/** @var SimpleArithmeticExpression */
public $simpleArithmeticExpression;
public Node|string $simpleArithmeticExpression;

public function getSql(SqlWalker $sqlWalker): string
{
Expand Down
8 changes: 3 additions & 5 deletions lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Doctrine\ORM\Query\AST\Functions;

use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;
Expand All @@ -17,11 +16,10 @@
*/
class LocateFunction extends FunctionNode
{
public Node $firstStringPrimary;
public Node $secondStringPrimary;
public Node|string $firstStringPrimary;
public Node|string $secondStringPrimary;

/** @var SimpleArithmeticExpression|bool */
public $simpleArithmeticExpression = false;
public Node|string|bool $simpleArithmeticExpression = false;

public function getSql(SqlWalker $sqlWalker): string
{
Expand Down
9 changes: 3 additions & 6 deletions lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\ORM\Query\AST\Functions;

use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;
Expand All @@ -16,11 +16,8 @@
*/
class ModFunction extends FunctionNode
{
/** @var SimpleArithmeticExpression */
public $firstSimpleArithmeticExpression;

/** @var SimpleArithmeticExpression */
public $secondSimpleArithmeticExpression;
public Node|string $firstSimpleArithmeticExpression;
public Node|string $secondSimpleArithmeticExpression;

public function getSql(SqlWalker $sqlWalker): string
{
Expand Down
5 changes: 2 additions & 3 deletions lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\ORM\Query\AST\Functions;

use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;
Expand All @@ -18,8 +18,7 @@
*/
class SqrtFunction extends FunctionNode
{
/** @var SimpleArithmeticExpression */
public $simpleArithmeticExpression;
public Node|string $simpleArithmeticExpression;

public function getSql(SqlWalker $sqlWalker): string
{
Expand Down
8 changes: 2 additions & 6 deletions lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Doctrine\ORM\Query\AST\Functions;

use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;
Expand All @@ -19,11 +18,8 @@ class SubstringFunction extends FunctionNode
{
public Node $stringPrimary;

/** @var SimpleArithmeticExpression */
public $firstSimpleArithmeticExpression;

/** @var SimpleArithmeticExpression|null */
public $secondSimpleArithmeticExpression = null;
public Node|string $firstSimpleArithmeticExpression;
public Node|string|null $secondSimpleArithmeticExpression = null;

public function getSql(SqlWalker $sqlWalker): string
{
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
*/
class NullComparisonExpression extends Node
{
/** @param Node $expression */
public function __construct(
public $expression,
public Node|string $expression,
public bool $not = false,
) {
}
Expand Down
Loading