Skip to content
Permalink
Browse files

Fixed some issues found by scrutinizer

  • Loading branch information...
lorenzo committed Dec 6, 2015
1 parent c2bd05c commit ff641d653c6d9735464ccac5586b98ed2bd19cd7
@@ -29,7 +29,7 @@ class TupleComparison extends Comparison
/**
* Constructor
*
* @param string $fields the fields to use to form a tuple
* @param string|array $fields the fields to use to form a tuple
* @param array|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
@@ -243,6 +243,9 @@ public function traverse(callable $visitor, array $parts = [])
* real field to be aliased. It is possible to alias strings, Expression objects or
* even other Query objects.
*
* If a callable function is passed, the returning array of the function will
* be used as the list of fields.
*
* By default this function will append any passed argument to the list of fields
* to be selected, unless the second argument is set to true.
*
@@ -253,13 +256,16 @@ public function traverse(callable $visitor, array $parts = [])
* $query->select(['author' => 'author_id']); // Appends author: SELECT id, title, author_id as author
* $query->select('id', true); // Resets the list: SELECT id
* $query->select(['total' => $countQuery]); // SELECT id, (SELECT ...) AS total
* $query->select(function ($query) {
* return ['article_id', 'total' => $query->count('*')];
* })
* ```
*
* By default no fields are selected, if you have an instance of `Cake\ORM\Query` and try to append
* fields you should also call `Cake\ORM\Query::autoFields()` to select the default fields
* from the table.
*
* @param array|ExpressionInterface|string $fields fields to be added to the list
* @param array|ExpressionInterface|string|callable $fields fields to be added to the list.
* @param bool $overwrite whether to reset fields with passed list or not
* @return $this
*/
@@ -307,7 +313,8 @@ public function select($fields = [], $overwrite = false)
* $query->distinct('name', true);
* ```
*
* @param array|ExpressionInterface|string $on fields to be filtered on
* @param array|ExpressionInterface|string|boolean $on Enable/disable disctinc class
* or list of fields to be filtered on
* @param bool $overwrite whether to reset fields with passed list or not
* @return $this
*/
@@ -434,7 +434,7 @@ public function cascadeDelete(EntityInterface $entity, array $options = [])
$bindingKey = (array)$this->bindingKey();
$conditions = [];
if ($bindingKey) {
if (!empty($bindingKey)) {
$conditions = array_combine($foreignKey, $entity->extract($bindingKey));
}
@@ -176,7 +176,7 @@ public function propertyPath()
* If called with no arguments it returns the current value.
*
* @param bool|null $possible The value to set.
* @return bool|null
* @return bool
*/
public function canBeJoined($possible = null)
{
@@ -194,7 +194,7 @@ public function canBeJoined($possible = null)
* value.
*
* @param array|null $config The value to set.
* @return array|null
* @return array
*/
public function config(array $config = null)
{
@@ -126,7 +126,7 @@ protected function _getPropertyMap($source, $associations)
* entities.
*
* @param array|\Traversable $objects The original list of entities
* @param \Cake\Collection\CollectionInterface $results The loaded results
* @param \Cake\Collection\CollectionInterface|\Cake\Database\Query $results The loaded results
* @param array $associations The top level associations that were loaded
* @param \Cake\ORM\Table $source The table where the entities came from
* @return array

0 comments on commit ff641d6

Please sign in to comment.
You can’t perform that action at this time.