Commit a55b83ea authored by Marco Pivetta's avatar Marco Pivetta Committed by GitHub

Merge pull request #2774 from AlessandroMinoccheri/fix_array_query_directory

fixed array declarations inside Query directory
parents 7baf4489 7a7ff795
...@@ -51,7 +51,7 @@ class CompositeExpression implements \Countable ...@@ -51,7 +51,7 @@ class CompositeExpression implements \Countable
* *
* @var array * @var array
*/ */
private $parts = array(); private $parts = [];
/** /**
* Constructor. * Constructor.
...@@ -59,7 +59,7 @@ class CompositeExpression implements \Countable ...@@ -59,7 +59,7 @@ class CompositeExpression implements \Countable
* @param string $type Instance type of composite expression. * @param string $type Instance type of composite expression.
* @param array $parts Composition of expressions to be joined on composite expression. * @param array $parts Composition of expressions to be joined on composite expression.
*/ */
public function __construct($type, array $parts = array()) public function __construct($type, array $parts = [])
{ {
$this->type = $type; $this->type = $type;
...@@ -73,7 +73,7 @@ class CompositeExpression implements \Countable ...@@ -73,7 +73,7 @@ class CompositeExpression implements \Countable
* *
* @return \Doctrine\DBAL\Query\Expression\CompositeExpression * @return \Doctrine\DBAL\Query\Expression\CompositeExpression
*/ */
public function addMultiple(array $parts = array()) public function addMultiple(array $parts = [])
{ {
foreach ((array) $parts as $part) { foreach ((array) $parts as $part) {
$this->add($part); $this->add($part);
......
...@@ -63,17 +63,17 @@ class QueryBuilder ...@@ -63,17 +63,17 @@ class QueryBuilder
/** /**
* @var array The array of SQL parts collected. * @var array The array of SQL parts collected.
*/ */
private $sqlParts = array( private $sqlParts = [
'select' => array(), 'select' => [],
'from' => array(), 'from' => [],
'join' => array(), 'join' => [],
'set' => array(), 'set' => [],
'where' => null, 'where' => null,
'groupBy' => array(), 'groupBy' => [],
'having' => null, 'having' => null,
'orderBy' => array(), 'orderBy' => [],
'values' => array(), 'values' => [],
); ];
/** /**
* The complete SQL string for this query. * The complete SQL string for this query.
...@@ -87,14 +87,14 @@ class QueryBuilder ...@@ -87,14 +87,14 @@ class QueryBuilder
* *
* @var array * @var array
*/ */
private $params = array(); private $params = [];
/** /**
* The parameter type map of this query. * The parameter type map of this query.
* *
* @var array * @var array
*/ */
private $paramTypes = array(); private $paramTypes = [];
/** /**
* The type of query this is. Can be select, update or delete. * The type of query this is. Can be select, update or delete.
...@@ -298,7 +298,7 @@ class QueryBuilder ...@@ -298,7 +298,7 @@ class QueryBuilder
* *
* @return $this This QueryBuilder instance. * @return $this This QueryBuilder instance.
*/ */
public function setParameters(array $params, array $types = array()) public function setParameters(array $params, array $types = [])
{ {
$this->paramTypes = $types; $this->paramTypes = $types;
$this->params = $params; $this->params = $params;
...@@ -527,10 +527,10 @@ class QueryBuilder ...@@ -527,10 +527,10 @@ class QueryBuilder
return $this; return $this;
} }
return $this->add('from', array( return $this->add('from', [
'table' => $delete, 'table' => $delete,
'alias' => $alias 'alias' => $alias
)); ]);
} }
/** /**
...@@ -557,10 +557,10 @@ class QueryBuilder ...@@ -557,10 +557,10 @@ class QueryBuilder
return $this; return $this;
} }
return $this->add('from', array( return $this->add('from', [
'table' => $update, 'table' => $update,
'alias' => $alias 'alias' => $alias
)); ]);
} }
/** /**
...@@ -590,9 +590,9 @@ class QueryBuilder ...@@ -590,9 +590,9 @@ class QueryBuilder
return $this; return $this;
} }
return $this->add('from', array( return $this->add('from', [
'table' => $insert 'table' => $insert
)); ]);
} }
/** /**
...@@ -612,10 +612,10 @@ class QueryBuilder ...@@ -612,10 +612,10 @@ class QueryBuilder
*/ */
public function from($from, $alias = null) public function from($from, $alias = null)
{ {
return $this->add('from', array( return $this->add('from', [
'table' => $from, 'table' => $from,
'alias' => $alias 'alias' => $alias
), true); ], true);
} }
/** /**
...@@ -659,14 +659,14 @@ class QueryBuilder ...@@ -659,14 +659,14 @@ class QueryBuilder
*/ */
public function innerJoin($fromAlias, $join, $alias, $condition = null) public function innerJoin($fromAlias, $join, $alias, $condition = null)
{ {
return $this->add('join', array( return $this->add('join', [
$fromAlias => array( $fromAlias => [
'joinType' => 'inner', 'joinType' => 'inner',
'joinTable' => $join, 'joinTable' => $join,
'joinAlias' => $alias, 'joinAlias' => $alias,
'joinCondition' => $condition 'joinCondition' => $condition
) ]
), true); ], true);
} }
/** /**
...@@ -688,14 +688,14 @@ class QueryBuilder ...@@ -688,14 +688,14 @@ class QueryBuilder
*/ */
public function leftJoin($fromAlias, $join, $alias, $condition = null) public function leftJoin($fromAlias, $join, $alias, $condition = null)
{ {
return $this->add('join', array( return $this->add('join', [
$fromAlias => array( $fromAlias => [
'joinType' => 'left', 'joinType' => 'left',
'joinTable' => $join, 'joinTable' => $join,
'joinAlias' => $alias, 'joinAlias' => $alias,
'joinCondition' => $condition 'joinCondition' => $condition
) ]
), true); ], true);
} }
/** /**
...@@ -717,14 +717,14 @@ class QueryBuilder ...@@ -717,14 +717,14 @@ class QueryBuilder
*/ */
public function rightJoin($fromAlias, $join, $alias, $condition = null) public function rightJoin($fromAlias, $join, $alias, $condition = null)
{ {
return $this->add('join', array( return $this->add('join', [
$fromAlias => array( $fromAlias => [
'joinType' => 'right', 'joinType' => 'right',
'joinTable' => $join, 'joinTable' => $join,
'joinAlias' => $alias, 'joinAlias' => $alias,
'joinCondition' => $condition 'joinCondition' => $condition
) ]
), true); ], true);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment