Skip to content

Commit

Permalink
Add Phpdoc to i* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Mar 4, 2024
1 parent a6be51c commit 820d38b
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 9 deletions.
9 changes: 8 additions & 1 deletion src/Query/Mysql/Inet6Aton.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@
use Doctrine\ORM\Query\TokenType;

/**
* "INET6_ATON" "(" StringPrimary ")"
* Inet6AtonFunction ::= "INET6_ATON" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_inet6-aton
*
* @example SELECT INET6_ATON("127.0.0.1")
* @example SELECT HEX(INET6_ATON("127.0.0.1"))
* @example SELECT HEX(INET6_ATON(foo.bar)) FROM entity
*/
class Inet6Aton extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
9 changes: 8 additions & 1 deletion src/Query/Mysql/Inet6Ntoa.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@
use Doctrine\ORM\Query\TokenType;

/**
* "INET6_NTOA" "(" StringPrimary ")"
* Inet6NtoaFunction ::= "INET6_NTOA" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_inet6-ntoa
*
* @example SELECT INET6_NTOA(0x7F000001)
* @example SELECT INET6_NTOA(UNHEX("7F000001"))
* @example SELECT INET6_NTOA(foo.bar) FROM entity
*/
class Inet6Ntoa extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
8 changes: 7 additions & 1 deletion src/Query/Mysql/InetAton.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
use Doctrine\ORM\Query\TokenType;

/**
* "INET_ATON" "(" StringPrimary ")"
* InetAtonFunction ::= "INET_ATON" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_inet-aton
*
* @example SELECT INET_ATON("127.0.0.1")
* @example SELECT INET_ATON(foo.bar) FROM entity
*/
class InetAton extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
8 changes: 7 additions & 1 deletion src/Query/Mysql/InetNtoa.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
use Doctrine\ORM\Query\TokenType;

/**
* "INET_NTOA" "(" StringPrimary ")"
* InetNtoaFunction ::= "INET_NTOA" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_inet-ntoa
*
* @example SELECT INET_NTOA(2130706433)
* @example SELECT INET_NTOA(foo.bar) FROM entity
*/
class InetNtoa extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
10 changes: 9 additions & 1 deletion src/Query/Mysql/Instr.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +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\SqlWalker;
use Doctrine\ORM\Query\TokenType;

use function sprintf;

/**
* "INSTR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
* InstrFunction ::= "INSTR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/string-functions.html#function_instr
*
* @example SELECT INSTR("foobar", "bar")
* @example SELECT INSTR(foo.bar, "bar") FROM entity
*/
class Instr extends FunctionNode
{
/** @var Node|string */
public $originalString = null;

/** @var Node|string */
public $subString = null;

public function parse(Parser $parser): void
Expand Down
8 changes: 7 additions & 1 deletion src/Query/Mysql/IsIpv4.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
use Doctrine\ORM\Query\TokenType;

/**
* "IS_IPV4" "(" StringPrimary ")"
* IsIpv4Function ::= "IS_IPV4" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_is-ipv4
*
* @example SELECT IS_IPV4("127.0.0.1")
* @example SELECT IS_IPV4(foo.bar) FROM entity
*/
class IsIpv4 extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
8 changes: 7 additions & 1 deletion src/Query/Mysql/IsIpv4Compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
use Doctrine\ORM\Query\TokenType;

/**
* "NAME" "(" args ")"
* IsIpv4CompatFunction ::= "IS_IPV4_COMPAT" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_is-ipv4-compat
*
* @example SELECT IS_IPV4_COMPAT(INET6_ATON('::127.0.0.1'))
* @example SELECT IS_IPV4_COMPAT(foo.bar) FROM entity
*/
class IsIpv4Compat extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
8 changes: 7 additions & 1 deletion src/Query/Mysql/IsIpv4Mapped.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
use Doctrine\ORM\Query\TokenType;

/**
* "IS_IPV4_MAPPED" "(" StringPrimary ")"
* IsIpv4MappedFunction ::= "IS_IPV4_MAPPED" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_is-ipv4-mapped
*
* @example SELECT IS_IPV4_MAPPED(INET6_ATON('::ffff:127.0.0.1'))
* @example SELECT IS_IPV4_MAPPED(foo.bar) FROM entity
*/
class IsIpv4Mapped extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down
8 changes: 7 additions & 1 deletion src/Query/Mysql/IsIpv6.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
use Doctrine\ORM\Query\TokenType;

/**
* "IS_IPV6" "(" StringPrimary ")"
* IsIpv6Function ::= "IS_IPV6" "(" StringPrimary ")"
*
* @link https://dev.mysql.com/doc/refman/en/miscellaneous-functions.html#function_is-ipv6
*
* @example SELECT IS_IPV6("::ffff:127.0.0.1")
* @example SELECT IS_IPV6(foo.bar) FROM entity
*/
class IsIpv6 extends FunctionNode
{
/** @var Node */
public $valueExpression = null;

/** @throws QueryException */
Expand Down

0 comments on commit 820d38b

Please sign in to comment.