Skip to content

Commit

Permalink
Fix expression doc blocks.
Browse files Browse the repository at this point in the history
Most of the expression class' methods do accept expression objects,
and/or actually use the same signature as the overridden methods.
  • Loading branch information
ndm2 committed Jan 16, 2017
1 parent 2d32a1e commit f10d092
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/Database/Expression/BetweenExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BetweenExpression implements ExpressionInterface, FieldInterface
/**
* Constructor
*
* @param mixed $field The field name to compare for values in between the range.
* @param string|\Cake\Database\ExpressionInterface $field The field name to compare for values in between the range.
* @param mixed $from The initial value of the range.
* @param mixed $to The ending value in the comparison range.
* @param string|null $type The data type name to bind the values with.
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/Comparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Comparison implements ExpressionInterface, FieldInterface
/**
* Constructor
*
* @param string $field the field name to compare to a value
* @param string|\Cake\Database\ExpressionInterface $field the field name to compare to a value
* @param mixed $value The value to be used in comparison
* @param string $type the type name used to cast the value
* @param string $operator the operator used for comparing field and value
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/FieldInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface FieldInterface
/**
* Sets the field name
*
* @param string $field The field to compare with.
* @param string|\Cake\Database\ExpressionInterface $field The field to compare with.
* @return void
*/
public function setField($field);
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Expression/FieldTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ trait FieldTrait
/**
* The field name or expression to be used in the left hand side of the operator
*
* @var string
* @var string|\Cake\Database\ExpressionInterface
*/
protected $_field;

/**
* Sets the field name
*
* @param string $field The field to compare with.
* @param string|\Cake\Database\ExpressionInterface $field The field to compare with.
* @return void
*/
public function setField($field)
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Expression/OrderByExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class OrderByExpression extends QueryExpression
/**
* Constructor
*
* @param array $conditions The sort columns
* @param array $types The types for each column.
* @param string|array|\Cake\Database\ExpressionInterface $conditions The sort columns
* @param array|\Cake\Database\TypeMap $types The types for each column.
* @param string $conjunction The glue used to join conditions together.
*/
public function __construct($conditions = [], $types = [], $conjunction = '')
Expand Down
32 changes: 16 additions & 16 deletions src/Database/Expression/QueryExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class QueryExpression implements ExpressionInterface, Countable
* expression objects. Optionally, you can set the conjunction keyword to be used
* for joining each part of this level of the expression tree.
*
* @param string|array|\Cake\Database\Expression\QueryExpression $conditions tree-like array structure containing all the conditions
* @param string|array|\Cake\Database\ExpressionInterface $conditions tree-like array structure containing all the conditions
* to be added or nested inside this expression object.
* @param array|\Cake\Database\TypeMap $types associative array of types to be associated with the values
* passed in $conditions.
Expand Down Expand Up @@ -145,7 +145,7 @@ public function add($conditions, $types = [])
/**
* Adds a new condition to the expression object in the form "field = value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* If it is suffixed with "[]" and the value is an array then multiple placeholders
Expand All @@ -164,7 +164,7 @@ public function eq($field, $value, $type = null)
/**
* Adds a new condition to the expression object in the form "field != value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* If it is suffixed with "[]" and the value is an array then multiple placeholders
Expand All @@ -183,7 +183,7 @@ public function notEq($field, $value, $type = null)
/**
* Adds a new condition to the expression object in the form "field > value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand All @@ -200,7 +200,7 @@ public function gt($field, $value, $type = null)
/**
* Adds a new condition to the expression object in the form "field < value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand All @@ -217,7 +217,7 @@ public function lt($field, $value, $type = null)
/**
* Adds a new condition to the expression object in the form "field >= value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand All @@ -234,7 +234,7 @@ public function gte($field, $value, $type = null)
/**
* Adds a new condition to the expression object in the form "field <= value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand Down Expand Up @@ -283,7 +283,7 @@ public function isNotNull($field)
/**
* Adds a new condition to the expression object in the form "field LIKE value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand All @@ -300,7 +300,7 @@ public function like($field, $value, $type = null)
/**
* Adds a new condition to the expression object in the form "field NOT LIKE value".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand All @@ -318,7 +318,7 @@ public function notLike($field, $value, $type = null)
* Adds a new condition to the expression object in the form
* "field IN (value1, value2)".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param string|array $values the value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand Down Expand Up @@ -355,7 +355,7 @@ public function addCase($conditions, $values = [], $types = [])
* Adds a new condition to the expression object in the form
* "field NOT IN (value1, value2)".
*
* @param string $field Database field to be compared against value
* @param string|\Cake\Database\ExpressionInterface $field Database field to be compared against value
* @param array $values the value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return $this
Expand Down Expand Up @@ -398,7 +398,7 @@ public function notExists(ExpressionInterface $query)
* Adds a new condition to the expression object in the form
* "field BETWEEN from AND to".
*
* @param mixed $field The field name to compare for values in between the range.
* @param string|\Cake\Database\ExpressionInterface $field The field name to compare for values in between the range.
* @param mixed $from The initial value of the range.
* @param mixed $to The ending value in the comparison range.
* @param string|null $type the type name for $value as configured using the Type map.
Expand All @@ -418,7 +418,7 @@ public function between($field, $from, $to, $type = null)
* Returns a new QueryExpression object containing all the conditions passed
* and set up the conjunction to be "AND"
*
* @param string|array|QueryExpression $conditions to be joined with AND
* @param string|array|\Cake\Database\ExpressionInterface $conditions to be joined with AND
* @param array $types associative array of fields pointing to the type of the
* values that are being passed. Used for correctly binding values to statements.
* @return \Cake\Database\Expression\QueryExpression
Expand All @@ -436,7 +436,7 @@ public function and_($conditions, $types = [])
* Returns a new QueryExpression object containing all the conditions passed
* and set up the conjunction to be "OR"
*
* @param string|array|QueryExpression $conditions to be joined with OR
* @param string|array|\Cake\Database\ExpressionInterface $conditions to be joined with OR
* @param array $types associative array of fields pointing to the type of the
* values that are being passed. Used for correctly binding values to statements.
* @return \Cake\Database\Expression\QueryExpression
Expand All @@ -457,7 +457,7 @@ public function or_($conditions, $types = [])
* "NOT ( (condition1) AND (conditions2) )" conjunction depends on the one
* currently configured for this object.
*
* @param string|array|\Cake\Database\Expression\QueryExpression $conditions to be added and negated
* @param string|array|\Cake\Database\ExpressionInterface $conditions to be added and negated
* @param array $types associative array of fields pointing to the type of the
* values that are being passed. Used for correctly binding values to statements.
* @return $this
Expand Down Expand Up @@ -763,7 +763,7 @@ protected function _parseCondition($field, $value)
/**
* Returns the type name for the passed field if it was stored in the typeMap
*
* @param string|\Cake\Database\Expression\QueryExpression $field The field name to get a type for.
* @param string|\Cake\Database\Expression\IdentifierExpression $field The field name to get a type for.
* @return string|null The computed type or null, if the type is unknown.
*/
protected function _calculateType($field)
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/TupleComparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TupleComparison extends Comparison
/**
* Constructor
*
* @param string|array $fields the fields to use to form a tuple
* @param string|array|\Cake\Database\ExpressionInterface $fields the fields to use to form a tuple
* @param array|\Cake\Database\ExpressionInterface $values the values to use to form a tuple
* @param array $types the types names to use for casting each of the values, only
* one type per position in the value array in needed
Expand Down

0 comments on commit f10d092

Please sign in to comment.