@@ -58,12 +58,12 @@ |
||
58 | 58 | $queryPart = (string) $part; |
59 | 59 | |
60 | 60 | if (is_object($part) && $part instanceof self && $part->count() > 1) { |
61 | - return $this->preSeparator . $queryPart . $this->postSeparator; |
|
61 | + return $this->preSeparator.$queryPart.$this->postSeparator; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Fixes DDC-1237: User may have added a where item containing nested expression (with "OR" or "AND") |
65 | 65 | if (stripos($queryPart, ' OR ') !== false || stripos($queryPart, ' AND ') !== false) { |
66 | - return $this->preSeparator . $queryPart . $this->postSeparator; |
|
66 | + return $this->preSeparator.$queryPart.$this->postSeparator; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $queryPart; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function add($arg) |
88 | 88 | { |
89 | - if ( $arg !== null && (!$arg instanceof self || $arg->count() > 0) ) { |
|
89 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
90 | 90 | // If we decide to keep Expr\Base instances, we can use this check |
91 | 91 | if ( ! is_string($arg)) { |
92 | 92 | $class = get_class($arg); |
@@ -119,6 +119,6 @@ discard block |
||
119 | 119 | return (string) $this->parts[0]; |
120 | 120 | } |
121 | 121 | |
122 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
122 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
123 | 123 | } |
124 | 124 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function add($sort, $order = null) |
76 | 76 | { |
77 | 77 | $order = ! $order ? 'ASC' : $order; |
78 | - $this->parts[] = $sort . ' '. $order; |
|
78 | + $this->parts[] = $sort.' '.$order; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -99,6 +99,6 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function __tostring() |
101 | 101 | { |
102 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
102 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
103 | 103 | } |
104 | 104 | } |
@@ -86,7 +86,7 @@ |
||
86 | 86 | */ |
87 | 87 | public function __toString() |
88 | 88 | { |
89 | - return $this->from . ' ' . $this->alias . |
|
90 | - ($this->indexBy ? ' INDEX BY ' . $this->indexBy : ''); |
|
89 | + return $this->from.' '.$this->alias. |
|
90 | + ($this->indexBy ? ' INDEX BY '.$this->indexBy : ''); |
|
91 | 91 | } |
92 | 92 | } |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
89 | 89 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); |
90 | 90 | |
91 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
92 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
91 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
92 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
93 | 93 | |
94 | 94 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); |
95 | 95 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); |
98 | 98 | |
99 | 99 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
100 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
100 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
101 | 101 | |
102 | 102 | // 3. Create and store UPDATE statements |
103 | 103 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | foreach (array_reverse($classNames) as $className) { |
107 | 107 | $affected = false; |
108 | 108 | $class = $em->getClassMetadata($className); |
109 | - $updateSql = 'UPDATE ' . $quoteStrategy->getTableName($class, $platform) . ' SET '; |
|
109 | + $updateSql = 'UPDATE '.$quoteStrategy->getTableName($class, $platform).' SET '; |
|
110 | 110 | |
111 | 111 | foreach ($updateItems as $updateItem) { |
112 | 112 | $field = $updateItem->pathExpression->field; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($affected) { |
136 | - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
136 | + $this->_sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | ); |
153 | 153 | } |
154 | 154 | |
155 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
156 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
155 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
156 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
157 | 157 | |
158 | 158 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
159 | 159 | } |
@@ -21,7 +21,6 @@ |
||
21 | 21 | |
22 | 22 | use Doctrine\DBAL\Connection; |
23 | 23 | use Doctrine\DBAL\Types\Type; |
24 | - |
|
25 | 24 | use Doctrine\ORM\Query\ParameterTypeInferer; |
26 | 25 | use Doctrine\ORM\Query\AST; |
27 | 26 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | public function startProduction($name) |
67 | 67 | { |
68 | - $this->println('(' . $name); |
|
68 | + $this->println('('.$name); |
|
69 | 69 | $this->_indent++; |
70 | 70 | } |
71 | 71 |
@@ -227,7 +227,9 @@ |
||
227 | 227 | $found = false; |
228 | 228 | |
229 | 229 | foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) { |
230 | - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; |
|
230 | + if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) { |
|
231 | + continue; |
|
232 | + } |
|
231 | 233 | |
232 | 234 | $this->addIndexByColumn($alias, $columnName); |
233 | 235 | $found = true; |
@@ -389,7 +389,7 @@ |
||
389 | 389 | /** |
390 | 390 | * Adds a metadata parameter mappings. |
391 | 391 | * |
392 | - * @param mixed $parameter The parameter name in the SQL result set. |
|
392 | + * @param string $parameter The parameter name in the SQL result set. |
|
393 | 393 | * @param string $attribute The metadata attribute. |
394 | 394 | */ |
395 | 395 | public function addMetadataParameterMapping($parameter, $attribute) |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | */ |
101 | 101 | final public function getParameter($name) |
102 | 102 | { |
103 | - if (!isset($this->parameters[$name])) { |
|
104 | - throw new \InvalidArgumentException("Parameter '" . $name . "' does not exist."); |
|
103 | + if ( ! isset($this->parameters[$name])) { |
|
104 | + throw new \InvalidArgumentException("Parameter '".$name."' does not exist."); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | final public function hasParameter($name) |
118 | 118 | { |
119 | - if (!isset($this->parameters[$name])) { |
|
119 | + if ( ! isset($this->parameters[$name])) { |
|
120 | 120 | return false; |
121 | 121 | } |
122 | 122 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function getRepository(EntityManagerInterface $entityManager, $entityName) |
43 | 43 | { |
44 | - $repositoryHash = $entityManager->getClassMetadata($entityName)->getName() . spl_object_hash($entityManager); |
|
44 | + $repositoryHash = $entityManager->getClassMetadata($entityName)->getName().spl_object_hash($entityManager); |
|
45 | 45 | |
46 | 46 | if (isset($this->repositoryList[$repositoryHash])) { |
47 | 47 | return $this->repositoryList[$repositoryHash]; |