Skip to content

Commit

Permalink
Add missing PhpDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Mar 1, 2024
1 parent 808cb4a commit a6be51c
Show file tree
Hide file tree
Showing 135 changed files with 952 additions and 67 deletions.
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,3 @@ parameters:
message: "#^Property DoctrineExtensions\\\\Query\\\\Mysql\\\\Lead\\:\\:\\$offset \\(Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticExpression\\) does not accept Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
path: src/Query/Mysql/Lead.php

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

-
message: "#^Property DoctrineExtensions\\\\Query\\\\Mysql\\\\Variance\\:\\:\\$arithmeticExpression \\(Doctrine\\\\ORM\\\\Query\\\\AST\\\\SimpleArithmeticExpression\\) does not accept Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
path: src/Query/Mysql/Variance.php
10 changes: 10 additions & 0 deletions src/Query/Mysql/Acos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
namespace DoctrineExtensions\Query\Mysql;

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

/**
* AcosFunction ::= "ACOS" "(" SimpleArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/mathematical-functions.html#function_acos
*
* @example SELECT ACOS(2)
* @example SELECT ACOS(foo.bar) FROM entity
*/
class Acos extends FunctionNode
{
/** @var Node|string */
public $arithmeticExpression;

public function getSql(SqlWalker $sqlWalker): string
Expand Down
13 changes: 12 additions & 1 deletion src/Query/Mysql/AddTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@
namespace DoctrineExtensions\Query\Mysql;

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

/** @author Pascal Wacker <hello@pascalwacker.ch> */
/**
* AddTimeFunction ::= "ADDTIME" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_addtime
*
* @author Pascal Wacker <hello@pascalwacker.ch>
* @example SELECT ADDTIME('2019-03-01 14:35:00', '01:02:03')
* @example SELECT ADDTIME(foo.bar, '01:02:03') FROM entity
*/
class AddTime extends FunctionNode
{
/** @var Node|string */
public $date;

/** @var Node|string */
public $time;

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

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

use function sprintf;

/**
* AesDecryptFunction ::= "AES_DECRYPT" "(" StringExpression "," StringExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/encryption-functions.html#function_aes-decrypt
*
* @example SELECT AES_DECRYPT(foo.crypt, foo.key) FROM entity
*/
class AesDecrypt extends FunctionNode
{
/** @var Node|Subselect|string */
public $field = '';

/** @var Node|Subselect|string */
public $key = '';

public function parse(Parser $parser): void
Expand Down
11 changes: 11 additions & 0 deletions src/Query/Mysql/AesEncrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@
namespace DoctrineExtensions\Query\Mysql;

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

use function sprintf;

/**
* AesEncryptFunction ::= "AES_ENCRYPT" "(" StringExpression "," StringExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/encryption-functions.html#function_aes-encrypt
*
* @example SELECT AES_ENCRYPT(foo.to_crypt, foo.key) FROM entity
*/
class AesEncrypt extends FunctionNode
{
/** @var Node|Subselect|string */
public $field = '';

/** @var Node|Subselect|string */
public $key = '';

public function parse(Parser $parser): void
Expand Down
9 changes: 9 additions & 0 deletions src/Query/Mysql/AnyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@
namespace DoctrineExtensions\Query\Mysql;

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

use function sprintf;

/**
* AnyValueFunction ::= "ANY_VALUE" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_any-value
*
* @example SELECT ANY_VALUE(foo.bar) FROM entity
*/
class AnyValue extends FunctionNode
{
/** @var Node */
public $value;

public function parse(Parser $parser): void
Expand Down
11 changes: 11 additions & 0 deletions src/Query/Mysql/Ascii.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@

namespace DoctrineExtensions\Query\Mysql;

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

/**
* AsciiFunction ::= "ASCII" "(" ArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/string-functions.html#function_ascii
*
* @example SELECT ASCII(foo.bar) FROM entity
* @example SELECT ASCII('2')
* @example SELECT ASCII(2)
*/
class Ascii extends FunctionNode
{
/** @var ArithmeticExpression */
private $string;

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

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

/**
* AsinFunction ::= "ASIN" "(" SimpleArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/mathematical-functions.html#function_asin
*
* @example SELECT ASIN(foo.bar) FROM entity
* @example SELECT ASIN(0.2)
*/
class Asin extends FunctionNode
{
/** @var Node|string */
public $arithmeticExpression;

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

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

/**
* AtanFunction ::= "ATAN" "(" SimpleArithmeticExpression [ "," SimpleArithmeticExpression ] ")"
*
* @link https://dev.mysql.com/doc/refman/en/mathematical-functions.html#function_atan
*
* @example SELECT ATAN(foo.bar) FROM entity
* @example SELECT ATAN(-2, 2)
* @example SELECT ATAN(PI(), 2)
*/
class Atan extends FunctionNode
{
/** @var Node|string */
public $arithmeticExpression;

/** @var Node|string */
public $optionalSecondExpression;

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

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

/**
* Atan2Function ::= "ATAN2" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/mathematical-functions.html#function_atan2
*
* @example SELECT ATAN2(-2, 2)
* @example SELECT ATAN2(PI(), 2)
* @example SELECT ATAN2(foo.bar, 2) FROM entity
*/
class Atan2 extends FunctionNode
{
/** @var Node|string */
public $firstExpression;

/** @var Node|string */
public $secondExpression;

public function getSql(SqlWalker $sqlWalker): string
Expand Down
13 changes: 12 additions & 1 deletion src/Query/Mysql/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@
namespace DoctrineExtensions\Query\Mysql;

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

/** @author Sarjono Mukti Aji <me@simukti.net> */
/**
* BinaryFunction ::= "BINARY" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/cast-functions.html#operator_binary
*
* @author Sarjono Mukti Aji <me@simukti.net>
* @example SELECT BINARY(foo.bar) FROM entity
* @example SELECT BINARY("string")
* @example SELECT BINARY(2)
*/
class Binary extends FunctionNode
{
/** @var Node */
private $stringPrimary;

public function parse(Parser $parser): void
Expand Down
10 changes: 10 additions & 0 deletions src/Query/Mysql/BitCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
namespace DoctrineExtensions\Query\Mysql;

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

/**
* BitCountFunction ::= "BIT_COUNT" "(" SimpleArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/bit-functions.html#function_bit-count
*
* @example SELECT BIT_COUNT(foo.bar) FROM entity
* @example SELECT BIT_COUNT(2)
*/
class BitCount extends FunctionNode
{
/** @var Node|string */
public $arithmeticExpression;

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

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

/**
* "BIT_XOR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
* BitXorFunction ::= "BIT_XOR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/aggregate-functions.html#function_bit-xor
*
* @example SELECT BIT_XOR(foo.bar, 2) FROM entity
* @example SELECT BIT_XOR(2, 2)
*/
class BitXor extends FunctionNode
{
/** @var Node|string */
public $firstArithmetic;

/** @var Node|string */
public $secondArithmetic;

public function getSql(SqlWalker $sqlWalker): string
Expand Down
8 changes: 5 additions & 3 deletions src/Query/Mysql/Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
use function sprintf;

/**
* "CAST" "(" "$fieldIdentifierExpression" "AS" "$castingTypeExpression" ")"
* "CAST" "(" SimpleArithmeticExpression "AS" Identifier [ "(" Literal { "," Literal }* ")" ] ")"
*
* @link https://dev.mysql.com/doc/refman/en/cast-functions.html#function_cast
*
* @example SELECT CAST(foo.bar AS SIGNED) FROM dual;
* @example SELECT CAST(foo.bar AS SIGNED) FROM entity
* @example SELECT CAST(foo.bar AS UNSIGNED) FROM entity
* @example SELECT CAST(foo.bar AS DECIMAL(2, 2)) FROM entity
*/
class Cast extends FunctionNode
{
/** @var Node */
/** @var Node|string */
protected $fieldIdentifierExpression;

/** @var string */
Expand Down
10 changes: 10 additions & 0 deletions src/Query/Mysql/Ceil.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
namespace DoctrineExtensions\Query\Mysql;

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

/**
* CeilFunction ::= "CEIL" "(" SimpleArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/mathematical-functions.html#function_ceil
*
* @example SELECT CEIL(foo.bar) FROM entity
* @example SELECT CEIL(2)
*/
class Ceil extends FunctionNode
{
/** @var Node|string */
private $arithmeticExpression;

public function getSql(SqlWalker $sqlWalker): string
Expand Down
12 changes: 11 additions & 1 deletion src/Query/Mysql/CharLength.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

namespace DoctrineExtensions\Query\Mysql;

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

/** @author Metod <metod@simpel.si> */
/**
* CharLengthFunction ::= "CHAR_LENGTH" "(" ArithmeticExpression ")"
*
* @link https://dev.mysql.com/doc/refman/en/string-functions.html#function_char-length
*
* @author Metod <metod@simpel.si>
* @example SELECT CHAR_LENGTH(foo.bar) FROM entity
* @example SELECT CHAR_LENGTH("string")
*/
class CharLength extends FunctionNode
{
/** @var ArithmeticExpression */
private $expr1;

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

0 comments on commit a6be51c

Please sign in to comment.