From 28966e2087e1fb0b9bdfe411b373e7c118f1480b Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Thu, 13 Dec 2012 12:05:34 +0000 Subject: [PATCH] Fixed documentation for Doctrine\ORM\Query\Expr and Doctrine\ORM\Query\Filter --- lib/Doctrine/ORM/Query/Expr/Andx.php | 3 +-- lib/Doctrine/ORM/Query/Expr/Base.php | 15 +++++++++------ lib/Doctrine/ORM/Query/Expr/Comparison.php | 9 ++++----- lib/Doctrine/ORM/Query/Expr/Composite.php | 9 ++++----- lib/Doctrine/ORM/Query/Expr/From.php | 9 ++++----- lib/Doctrine/ORM/Query/Expr/Func.php | 7 +++---- lib/Doctrine/ORM/Query/Expr/GroupBy.php | 3 +-- lib/Doctrine/ORM/Query/Expr/Join.php | 16 +++++++--------- lib/Doctrine/ORM/Query/Expr/Literal.php | 4 +--- lib/Doctrine/ORM/Query/Expr/Math.php | 9 ++++----- lib/Doctrine/ORM/Query/Expr/OrderBy.php | 13 +++++++------ lib/Doctrine/ORM/Query/Expr/Orx.php | 3 +-- lib/Doctrine/ORM/Query/Expr/Select.php | 3 +-- lib/Doctrine/ORM/Query/Filter/SQLFilter.php | 21 ++++++++++++++------- 14 files changed, 61 insertions(+), 63 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Expr/Andx.php b/lib/Doctrine/ORM/Query/Expr/Andx.php index 10b5e8e6e..432f714f6 100644 --- a/lib/Doctrine/ORM/Query/Expr/Andx.php +++ b/lib/Doctrine/ORM/Query/Expr/Andx.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for building DQL and parts + * Expression class for building DQL and parts. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco diff --git a/lib/Doctrine/ORM/Query/Expr/Base.php b/lib/Doctrine/ORM/Query/Expr/Base.php index a2bc98cc7..28771890c 100644 --- a/lib/Doctrine/ORM/Query/Expr/Base.php +++ b/lib/Doctrine/ORM/Query/Expr/Base.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Abstract base Expr class for building DQL parts + * Abstract base Expr class for building DQL parts. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -65,8 +64,9 @@ abstract class Base } /** - * @param array $args - * @return Base + * @param array $args + * + * @return Base */ public function addMultiple($args = array()) { @@ -78,8 +78,11 @@ abstract class Base } /** - * @param mixed $arg - * @return Base + * @param mixed $arg + * + * @return Base + * + * @throws \InvalidArgumentException */ public function add($arg) { diff --git a/lib/Doctrine/ORM/Query/Expr/Comparison.php b/lib/Doctrine/ORM/Query/Expr/Comparison.php index 52070df60..4103dcea9 100644 --- a/lib/Doctrine/ORM/Query/Expr/Comparison.php +++ b/lib/Doctrine/ORM/Query/Expr/Comparison.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for DQL comparison expressions + * Expression class for DQL comparison expressions. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -56,9 +55,9 @@ class Comparison /** * Creates a comparison expression with the given arguments. * - * @param mixed $leftExpr - * @param string $operator - * @param mixed $rightExpr + * @param mixed $leftExpr + * @param string $operator + * @param mixed $rightExpr */ public function __construct($leftExpr, $operator, $rightExpr) { diff --git a/lib/Doctrine/ORM/Query/Expr/Composite.php b/lib/Doctrine/ORM/Query/Expr/Composite.php index cc0e0e8f3..4d9a25198 100644 --- a/lib/Doctrine/ORM/Query/Expr/Composite.php +++ b/lib/Doctrine/ORM/Query/Expr/Composite.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for building DQL and parts + * Expression class for building DQL and parts. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -49,10 +48,10 @@ class Composite extends Base return implode($this->separator, $components); } - /** - * @param string $part - * @return string + * @param string $part + * + * @return string */ private function processQueryPart($part) { diff --git a/lib/Doctrine/ORM/Query/Expr/From.php b/lib/Doctrine/ORM/Query/Expr/From.php index 3a37703d2..9dcce9bbe 100644 --- a/lib/Doctrine/ORM/Query/Expr/From.php +++ b/lib/Doctrine/ORM/Query/Expr/From.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for DQL from + * Expression class for DQL from. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -47,9 +46,9 @@ class From protected $indexBy; /** - * @param string $from The class name. - * @param string $alias The alias of the class. - * @param string $indexBy The index for the from. + * @param string $from The class name. + * @param string $alias The alias of the class. + * @param string $indexBy The index for the from. */ public function __construct($from, $alias, $indexBy = null) { diff --git a/lib/Doctrine/ORM/Query/Expr/Func.php b/lib/Doctrine/ORM/Query/Expr/Func.php index 6917dd230..b4ed07cd3 100644 --- a/lib/Doctrine/ORM/Query/Expr/Func.php +++ b/lib/Doctrine/ORM/Query/Expr/Func.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for generating DQL functions + * Expression class for generating DQL functions. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -44,8 +43,8 @@ class Func /** * Creates a function, with the given argument. * - * @param string $name - * @param array $arguments + * @param string $name + * @param array $arguments */ public function __construct($name, $arguments) { diff --git a/lib/Doctrine/ORM/Query/Expr/GroupBy.php b/lib/Doctrine/ORM/Query/Expr/GroupBy.php index 40bb838ff..efa3582bd 100644 --- a/lib/Doctrine/ORM/Query/Expr/GroupBy.php +++ b/lib/Doctrine/ORM/Query/Expr/GroupBy.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for building DQL Group By parts + * Expression class for building DQL Group By parts. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco diff --git a/lib/Doctrine/ORM/Query/Expr/Join.php b/lib/Doctrine/ORM/Query/Expr/Join.php index 41f454fcd..c7ca935eb 100644 --- a/lib/Doctrine/ORM/Query/Expr/Join.php +++ b/lib/Doctrine/ORM/Query/Expr/Join.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for DQL from + * Expression class for DQL join. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -68,12 +67,12 @@ class Join protected $indexBy; /** - * @param string $joinType The condition type constant. Either INNER_JOIN or LEFT_JOIN. - * @param string $join The relationship to join - * @param string $alias The alias of the join - * @param string $conditionType The condition type constant. Either ON or WITH. - * @param string $condition The condition for the join - * @param string $indexBy The index for the join + * @param string $joinType The condition type constant. Either INNER_JOIN or LEFT_JOIN. + * @param string $join The relationship to join. + * @param string|null $alias The alias of the join. + * @param string|null $conditionType The condition type constant. Either ON or WITH. + * @param string|null $condition The condition for the join. + * @param string|null $indexBy The index for the join. */ public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null) { @@ -133,7 +132,6 @@ class Join return $this->indexBy; } - /** * @return string */ diff --git a/lib/Doctrine/ORM/Query/Expr/Literal.php b/lib/Doctrine/ORM/Query/Expr/Literal.php index 991b04430..98cee79d7 100644 --- a/lib/Doctrine/ORM/Query/Expr/Literal.php +++ b/lib/Doctrine/ORM/Query/Expr/Literal.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for generating DQL functions + * Expression class for generating DQL functions. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -48,5 +47,4 @@ class Literal extends Base { return $this->parts; } - } diff --git a/lib/Doctrine/ORM/Query/Expr/Math.php b/lib/Doctrine/ORM/Query/Expr/Math.php index a41c848d8..9bf800de8 100644 --- a/lib/Doctrine/ORM/Query/Expr/Math.php +++ b/lib/Doctrine/ORM/Query/Expr/Math.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for DQL math statements + * Expression class for DQL math statements. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -49,9 +48,9 @@ class Math /** * Creates a mathematical expression with the given arguments. * - * @param mixed $leftExpr - * @param string $operator - * @param mixed $rightExpr + * @param mixed $leftExpr + * @param string $operator + * @param mixed $rightExpr */ public function __construct($leftExpr, $operator, $rightExpr) { diff --git a/lib/Doctrine/ORM/Query/Expr/OrderBy.php b/lib/Doctrine/ORM/Query/Expr/OrderBy.php index e0e7ffcdb..932548bd6 100644 --- a/lib/Doctrine/ORM/Query/Expr/OrderBy.php +++ b/lib/Doctrine/ORM/Query/Expr/OrderBy.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for building DQL Order By parts + * Expression class for building DQL Order By parts. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -57,8 +56,8 @@ class OrderBy protected $parts = array(); /** - * @param string $sort - * @param string $order + * @param string|null $sort + * @param string|null $order */ public function __construct($sort = null, $order = null) { @@ -68,8 +67,10 @@ class OrderBy } /** - * @param string $sort - * @param string $order + * @param string $sort + * @param string|null $order + * + * @return void */ public function add($sort, $order = null) { diff --git a/lib/Doctrine/ORM/Query/Expr/Orx.php b/lib/Doctrine/ORM/Query/Expr/Orx.php index caecba638..c4ff7ae30 100644 --- a/lib/Doctrine/ORM/Query/Expr/Orx.php +++ b/lib/Doctrine/ORM/Query/Expr/Orx.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for building DQL OR clauses + * Expression class for building DQL OR clauses. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco diff --git a/lib/Doctrine/ORM/Query/Expr/Select.php b/lib/Doctrine/ORM/Query/Expr/Select.php index 804d797d8..21df6c735 100644 --- a/lib/Doctrine/ORM/Query/Expr/Select.php +++ b/lib/Doctrine/ORM/Query/Expr/Select.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query\Expr; /** - * Expression class for building DQL select statements + * Expression class for building DQL select statements. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco diff --git a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php index 528397ad9..61bc1192d 100644 --- a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php +++ b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php @@ -36,12 +36,14 @@ abstract class SQLFilter { /** * The entity manager. + * * @var EntityManager */ private $em; /** * Parameters for the filter. + * * @var array */ private $parameters; @@ -49,7 +51,7 @@ abstract class SQLFilter /** * Constructs the SQLFilter object. * - * @param EntityManager $em The EM + * @param EntityManager $em The entity manager. */ final public function __construct(EntityManager $em) { @@ -59,11 +61,11 @@ abstract class SQLFilter /** * Sets a parameter that can be used by the filter. * - * @param string $name Name of the parameter. - * @param string $value Value of the parameter. - * @param string $type The parameter type. If specified, the given value will be run through - * the type conversion of this type. This is usually not needed for - * strings and numeric types. + * @param string $name Name of the parameter. + * @param string $value Value of the parameter. + * @param string|null $type The parameter type. If specified, the given value will be run through + * the type conversion of this type. This is usually not needed for + * strings and numeric types. * * @return SQLFilter The current SQL filter. */ @@ -93,6 +95,8 @@ abstract class SQLFilter * @param string $name Name of the parameter. * * @return string The SQL escaped parameter to use in a query. + * + * @throws \InvalidArgumentException */ final public function getParameter($name) { @@ -116,7 +120,10 @@ abstract class SQLFilter /** * Gets the SQL query part to add to a query. * - * @return string The constraint SQL if there is available, empty string otherwise + * @param ClassMetaData $targetEntity + * @param string $targetTableAlias + * + * @return string The constraint SQL if there is available, empty string otherwise. */ abstract public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias); }