diff --git a/.php_cs b/.php_cs index e569f1076..29d497aef 100644 --- a/.php_cs +++ b/.php_cs @@ -29,6 +29,7 @@ $config = PhpCsFixer\Config::create() 'explicit_string_variable' => true, 'fully_qualified_strict_types' => true, 'function_typehint_space' => true, + 'general_phpdoc_annotation_remove' => ['category', 'license'], 'hash_to_slash_comment' => true, 'heredoc_to_nowdoc' => true, 'include' => true, diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 605bf109b..57986323c 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -13,11 +13,9 @@ /** * "CAST" "(" "$fieldIdentifierExpression" "AS" "$castingTypeExpression" ")" * - * @example - * SELECT CAST(foo.bar AS SIGNED) FROM dual; + * @example SELECT CAST(foo.bar AS SIGNED) FROM dual; * - * @link https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/dql-user-defined-functions.html#conclusion - * @link https://dev.mysql.com/doc/refman/5.6/en/cast-functions.html#function_cast + * @link https://dev.mysql.com/doc/refman/en/cast-functions.html#function_cast */ class Cast extends FunctionNode { diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index bd9849a3e..f6aa4236b 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -6,14 +6,8 @@ use Doctrine\ORM\Query\Lexer; /** - * "COLLATE" - * override the default collation - * More info: - * https://dev.mysql.com/doc/refman/5.7/en/charset-collate.html - * - * @category DoctrineExtensions - * @author Peter Tanath - * @license MIT License + * @link https://dev.mysql.com/doc/refman/en/charset-collate.html + * @author Peter Tanath */ class Collate extends FunctionNode { diff --git a/src/Query/Mysql/ConvertTz.php b/src/Query/Mysql/ConvertTz.php index af124f7cd..0c302ddd1 100644 --- a/src/Query/Mysql/ConvertTz.php +++ b/src/Query/Mysql/ConvertTz.php @@ -8,11 +8,7 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Converts timezones. - * - * Allows Doctrine 2 Query Language to execute a MySQL CONVERT_TZ function. - * - * @link http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_convert-tz + * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_convert-tz */ class ConvertTz extends FunctionNode { @@ -23,7 +19,7 @@ class ConvertTz extends FunctionNode protected $toTz; /** - * {@inheritdoc} + * @inheritdoc */ public function getSql(SqlWalker $sqlWalker) { @@ -36,7 +32,7 @@ public function getSql(SqlWalker $sqlWalker) } /** - * {@inheritdoc} + * @inheritdoc */ public function parse(Parser $parser) { diff --git a/src/Query/Mysql/Date.php b/src/Query/Mysql/Date.php index d588c997b..cfb042f42 100644 --- a/src/Query/Mysql/Date.php +++ b/src/Query/Mysql/Date.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Query\Lexer; /** - * @author Steve Lacey + * @author Steve Lacey */ class Date extends FunctionNode { diff --git a/src/Query/Mysql/DateFormat.php b/src/Query/Mysql/DateFormat.php index 2ec877b06..bd7a7e74c 100644 --- a/src/Query/Mysql/DateFormat.php +++ b/src/Query/Mysql/DateFormat.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Query\Lexer; /** - * @author Steve Lacey + * @author Steve Lacey */ class DateFormat extends FunctionNode { diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index 518ea0279..b1c94d797 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -5,8 +5,6 @@ use Doctrine\ORM\Query\QueryException; /** - * Class DateSub - * * @author Vas N */ class DateSub extends DateAdd diff --git a/src/Query/Mysql/DayName.php b/src/Query/Mysql/DayName.php index 4cbaef3cd..59552c46d 100644 --- a/src/Query/Mysql/DayName.php +++ b/src/Query/Mysql/DayName.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Query\Lexer; /** - * @author Steve Lacey + * @author Steve Lacey */ class DayName extends FunctionNode { diff --git a/src/Query/Mysql/Div.php b/src/Query/Mysql/Div.php index 51e32d0ad..cdc13b505 100644 --- a/src/Query/Mysql/Div.php +++ b/src/Query/Mysql/Div.php @@ -8,9 +8,7 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Performs an integer division. This is a MySQL operator, implemented as a Doctrine function. - * - * @see http://dev.mysql.com/doc/refman/en/arithmetic-functions.html#operator_div + * @link https://dev.mysql.com/doc/refman/en/arithmetic-functions.html#operator_div */ class Div extends FunctionNode { diff --git a/src/Query/Mysql/FromBase64.php b/src/Query/Mysql/FromBase64.php index d15ebc7d2..d0aa545f9 100644 --- a/src/Query/Mysql/FromBase64.php +++ b/src/Query/Mysql/FromBase64.php @@ -10,10 +10,9 @@ /** * "FROM_BASE64" "(" "$fieldIdentifierExpression" ")" * - * @example - * SELECT FROM_BASE64(foo) FROM dual; + * @example SELECT FROM_BASE64(foo) FROM dual; * - * @link https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_from-base64 + * @link https://dev.mysql.com/doc/refman/en/string-functions.html#function_from-base64 */ class FromBase64 extends FunctionNode { diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index 1d088fbd1..b370a19bb 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -8,8 +8,6 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Class Greatest - * * @author Vas N * @author Guven Atbakan */ diff --git a/src/Query/Mysql/Instr.php b/src/Query/Mysql/Instr.php index 856e2f34c..3cc8a876d 100644 --- a/src/Query/Mysql/Instr.php +++ b/src/Query/Mysql/Instr.php @@ -7,10 +7,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * Class Instr - * @author Jan H - */ class Instr extends FunctionNode { public $originalString = null; diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index 8d19c5fc9..1338b38ec 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -8,8 +8,6 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Class Least - * * @author Vas N */ class Least extends FunctionNode diff --git a/src/Query/Mysql/MonthName.php b/src/Query/Mysql/MonthName.php index 353b6bd8d..c59764601 100644 --- a/src/Query/Mysql/MonthName.php +++ b/src/Query/Mysql/MonthName.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Query\Lexer; /** - * @author Steve Lacey + * @author Steve Lacey */ class MonthName extends FunctionNode { diff --git a/src/Query/Mysql/SecToTime.php b/src/Query/Mysql/SecToTime.php index cc5bb7358..e26a365d0 100644 --- a/src/Query/Mysql/SecToTime.php +++ b/src/Query/Mysql/SecToTime.php @@ -1,45 +1,24 @@ - * @license MIT License + * @example SELECT SEC_TO_TIME(2378); + * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_sec-to-time + * @author Clemens Bastian */ class SecToTime extends FunctionNode { public $time; - /** - * @override - */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'SEC_TO_TIME('.$sqlWalker->walkArithmeticPrimary($this->time).')'; } - /** - * @override - */ public function parse(\Doctrine\ORM\Query\Parser $parser) { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/SubstringIndex.php b/src/Query/Mysql/SubstringIndex.php index a3202b02d..85a5f38f6 100644 --- a/src/Query/Mysql/SubstringIndex.php +++ b/src/Query/Mysql/SubstringIndex.php @@ -7,10 +7,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * Class SubstringIndex - * @author Vas N - */ class SubstringIndex extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/Time.php b/src/Query/Mysql/Time.php index bb7216b01..04820389d 100644 --- a/src/Query/Mysql/Time.php +++ b/src/Query/Mysql/Time.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Query\Lexer; /** - * @author Steve Lacey + * @author Steve Lacey * @author James Rohacik */ class Time extends FunctionNode diff --git a/src/Query/Mysql/TimeToSec.php b/src/Query/Mysql/TimeToSec.php index 57a7a32b6..3b4b87446 100644 --- a/src/Query/Mysql/TimeToSec.php +++ b/src/Query/Mysql/TimeToSec.php @@ -1,45 +1,24 @@ - * @license MIT License + * @example SELECT TIME_TO_SEC('22:23:00'); + * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_time-to-sec + * @author Pawel Stasicki */ class TimeToSec extends FunctionNode { public $time; - /** - * @override - */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'TIME_TO_SEC('.$sqlWalker->walkArithmeticPrimary($this->time).')'; } - /** - * @override - */ public function parse(\Doctrine\ORM\Query\Parser $parser) { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/UnixTimestamp.php b/src/Query/Mysql/UnixTimestamp.php index 56b5d7aa6..7be1a1ce9 100644 --- a/src/Query/Mysql/UnixTimestamp.php +++ b/src/Query/Mysql/UnixTimestamp.php @@ -13,9 +13,6 @@ class UnixTimestamp extends FunctionNode { public $date; - /** - * @override - */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return sprintf( @@ -24,9 +21,6 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) ); } - /** - * @override - */ public function parse(\Doctrine\ORM\Query\Parser $parser) { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/YearMonth.php b/src/Query/Mysql/YearMonth.php index 922144119..edafdaf74 100644 --- a/src/Query/Mysql/YearMonth.php +++ b/src/Query/Mysql/YearMonth.php @@ -1,17 +1,5 @@ match(Lexer::T_IDENTIFIER); diff --git a/src/Query/MysqlWalker.php b/src/Query/MysqlWalker.php index 8f214b123..1698088d3 100644 --- a/src/Query/MysqlWalker.php +++ b/src/Query/MysqlWalker.php @@ -6,37 +6,36 @@ class MysqlWalker extends SqlWalker { - /** {@inheritDoc} */ + /** + * @inheritdoc + */ public function walkSelectClause($selectClause) { $sql = parent::walkSelectClause($selectClause); - // Gets the query $query = $this->getQuery(); if ($query->getHint('mysqlWalker.sqlCalcFoundRows') === true) { - // Appends the SQL_CALC_FOUND_ROWS modifier $sql = str_replace('SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $sql); } if ($query->getHint('mysqlWalker.sqlNoCache') === true) { - // Appends the SQL_NO_CACHE modifier $sql = str_replace('SELECT', 'SELECT SQL_NO_CACHE', $sql); } return $sql; } - /** {@inheritDoc} */ + /** + * @inheritdoc + */ public function walkGroupByClause($groupByClause) { $sql = parent::walkGroupByClause($groupByClause); - // Gets the query $query = $this->getQuery(); if ($query->getHint('mysqlWalker.withRollup') === true) { - // Appends the WITH ROLLUP modifier $sql .= ' WITH ROLLUP'; } diff --git a/src/Query/Postgresql/Date.php b/src/Query/Postgresql/Date.php index 43f3ac2db..d59931187 100644 --- a/src/Query/Postgresql/Date.php +++ b/src/Query/Postgresql/Date.php @@ -5,9 +5,6 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; -/** - * @author Steve Lacey - */ class Date extends FunctionNode { public $date; diff --git a/src/Query/Postgresql/DateFormat.php b/src/Query/Postgresql/DateFormat.php index 98431e67b..5bcd419ee 100644 --- a/src/Query/Postgresql/DateFormat.php +++ b/src/Query/Postgresql/DateFormat.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Query\Lexer; /** - * @author silvioq + * @author Silvio */ class DateFormat extends FunctionNode { diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 9705c29d0..c2a6e1830 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -8,8 +8,6 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Class Greatest - * * @author Vas N * @author Guven Atbakan * @author Leonardo B Motyczka diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 4461e5c2c..ad05b5bc2 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -8,8 +8,6 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Class Least - * * @author Vas N * @author Leonardo B Motyczka */ diff --git a/src/Query/Postgresql/RegexpReplace.php b/src/Query/Postgresql/RegexpReplace.php index bcbfdc2d8..cf2ed8feb 100644 --- a/src/Query/Postgresql/RegexpReplace.php +++ b/src/Query/Postgresql/RegexpReplace.php @@ -6,10 +6,8 @@ use Doctrine\ORM\Query\Lexer; /** - * RegexpReplace string using postgresql function regexp_replace : - * https://www.postgresql.org/docs/9.6/functions-matching.html#FUNCTIONS-POSIX-TABLE - * - * Usage : StringFunction REGEXP_REPLACE(string, search, replace) + * @example SELECT REGEXP_REPLACE(string, search, replace) + * @link https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-TABLE */ class RegexpReplace extends FunctionNode { diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index 5eef85ba9..cd36996ef 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -8,8 +8,6 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Class Greatest - * * @author Vas N * @author Guven Atbakan */ diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index 1a489c4ae..63e31abcf 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -8,8 +8,6 @@ use Doctrine\ORM\Query\SqlWalker; /** - * Class Least - * * @author Vas N */ class Least extends FunctionNode