Skip to content

Commit

Permalink
Merge pull request #380 from maikelohcfg/php8-patch
Browse files Browse the repository at this point in the history
php 8.0 return types compatible
  • Loading branch information
beberlei authored Jun 21, 2022
2 parents 3d6abcb + b5d6a31 commit f3536d8
Show file tree
Hide file tree
Showing 175 changed files with 341 additions and 335 deletions.
4 changes: 2 additions & 2 deletions src/Query/Mysql/Acos.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Acos extends FunctionNode
{
public $arithmeticExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'ACOS(' . $sqlWalker->walkSimpleArithmeticExpression(
$this->arithmeticExpression
) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/AddTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class AddTime extends FunctionNode

public $time;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'ADDTIME(' . $sqlWalker->walkArithmeticPrimary($this->date) . ', ' . $sqlWalker->walkArithmeticPrimary($this->time) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/AesDecrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AesDecrypt extends FunctionNode

public $key = '';

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand All @@ -21,7 +21,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser)
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return sprintf(
'AES_DECRYPT(%s, %s)',
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/AesEncrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AesEncrypt extends FunctionNode

public $key = '';

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand All @@ -21,7 +21,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser)
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return sprintf(
'AES_ENCRYPT(%s, %s)',
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/AnyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class AnyValue extends FunctionNode
{
public $value;

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

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return sprintf(
'ANY_VALUE(%s)',
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Ascii.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class Ascii extends FunctionNode
{
private $string;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'ASCII('.$sqlWalker->walkArithmeticPrimary($this->string).')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Asin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Asin extends FunctionNode
{
public $arithmeticExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'ASIN(' . $sqlWalker->walkSimpleArithmeticExpression(
$this->arithmeticExpression
) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Atan.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Atan extends FunctionNode

public $optionalSecondExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
$secondArgument = '';

Expand All @@ -28,7 +28,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
. ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Atan2.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Atan2 extends FunctionNode

public $secondExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
$firstArgument = $sqlWalker->walkSimpleArithmeticExpression(
$this->firstExpression
Expand All @@ -24,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
return 'ATAN2(' . $firstArgument . ', ' . $secondArgument . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Binary extends FunctionNode
{
private $stringPrimary;

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand All @@ -22,7 +22,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser)
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'BINARY('.$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary).')';
}
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/BitCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class BitCount extends FunctionNode
{
public $arithmeticExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'BIT_COUNT(' . $sqlWalker->walkSimpleArithmeticExpression(
$this->arithmeticExpression
)
. ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/BitXor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class BitXor extends FunctionNode

public $secondArithmetic;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return $this->firstArithmetic->dispatch($sqlWalker)
. ' ^ '
. $this->secondArithmetic->dispatch($sqlWalker);
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Cast extends FunctionNode
*
* @throws QueryException
*/
public function parse(Parser $parser)
public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down Expand Up @@ -70,7 +70,7 @@ public function parse(Parser $parser)
*
* @return string
*/
public function getSql(SqlWalker $sqlWalker)
public function getSql(SqlWalker $sqlWalker): string
{
return sprintf(
'CAST(%s AS %s)',
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Ceil.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class Ceil extends FunctionNode
{
private $arithmeticExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'CEIL(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/CharLength.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class CharLength extends FunctionNode
{
private $expr;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'CHAR_LENGTH('.$sqlWalker->walkArithmeticPrimary($this->expr1).')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Collate.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Collate extends FunctionNode
/**
* @param \Doctrine\ORM\Query\Parser $parser
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand All @@ -45,7 +45,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser)
* @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
* @return string
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return sprintf('%s COLLATE %s', $sqlWalker->walkStringPrimary($this->stringPrimary), $this->collation);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/ConcatWs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConcatWs extends FunctionNode

private $notEmpty = false;

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down Expand Up @@ -53,7 +53,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser)
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
// Create an array to hold the query elements.
$queryBuilder = ['CONCAT_WS('];
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/ConvertTz.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ConvertTz extends FunctionNode
/**
* @inheritdoc
*/
public function getSql(SqlWalker $sqlWalker)
public function getSql(SqlWalker $sqlWalker): string
{
return sprintf(
'CONVERT_TZ(%s, %s, %s)',
Expand All @@ -34,7 +34,7 @@ public function getSql(SqlWalker $sqlWalker)
/**
* @inheritdoc
*/
public function parse(Parser $parser)
public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Cos.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Cos extends FunctionNode
{
public $arithmeticExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'COS(' . $sqlWalker->walkSimpleArithmeticExpression(
$this->arithmeticExpression
) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Cot.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Cot extends FunctionNode
{
public $arithmeticExpression;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'COT(' . $sqlWalker->walkSimpleArithmeticExpression(
$this->arithmeticExpression
) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/CountIf.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CountIf extends FunctionNode

private $inverse = false;

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand All @@ -43,7 +43,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser)
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return sprintf(
'COUNT(CASE %s WHEN %s THEN %s END)',
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Crc32.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class Crc32 extends FunctionNode
{
public $stringPrimary;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'CRC32(' .
$sqlWalker->walkStringPrimary($this->stringPrimary) .
')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class Date extends FunctionNode
{
public $date;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'DATE(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')';
}

public function parse(\Doctrine\ORM\Query\Parser $parser)
public function parse(\Doctrine\ORM\Query\Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
Expand Down
Loading

0 comments on commit f3536d8

Please sign in to comment.