@@ -21,7 +21,6 @@  | 
                                                    ||
| 21 | 21 | namespace Doctrine\ORM\Cache;  | 
                                                        
| 22 | 22 | |
| 23 | 23 | use Doctrine\Common\Util\ClassUtils;  | 
                                                        
| 24 | -  | 
                                                        |
| 25 | 24 | use Doctrine\ORM\Query;  | 
                                                        
| 26 | 25 | use Doctrine\ORM\Mapping\ClassMetadata;  | 
                                                        
| 27 | 26 | use Doctrine\ORM\EntityManagerInterface;  | 
                                                        
@@ -109,7 +109,7 @@ discard block  | 
                                                    ||
| 109 | 109 | |
| 110 | 110 | $targetAssoc = $targetClassMetadata->associationMappings[$fieldName];  | 
                                                        
| 111 | 111 | |
| 112 | -                    foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { | 
                                                        |
| 112 | +                    foreach ($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { | 
                                                        |
| 113 | 113 |                          if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) { | 
                                                        
| 114 | 114 | $data[$localColumn] = $fieldValue;  | 
                                                        
| 115 | 115 | }  | 
                                                        
@@ -161,7 +161,7 @@ discard block  | 
                                                    ||
| 161 | 161 | }  | 
                                                        
| 162 | 162 | |
| 163 | 163 |          foreach ($metadata->associationMappings as $name => $assoc) { | 
                                                        
| 164 | -            if ( ! isset($assoc['cache']) ||  ! isset($data[$name])) { | 
                                                        |
| 164 | +            if ( ! isset($assoc['cache']) || ! isset($data[$name])) { | 
                                                        |
| 165 | 165 | continue;  | 
                                                        
| 166 | 166 | }  | 
                                                        
| 167 | 167 | |
@@ -282,7 +282,7 @@  | 
                                                    ||
| 282 | 282 | /**  | 
                                                        
| 283 | 283 | * Generates a string of currently query  | 
                                                        
| 284 | 284 | *  | 
                                                        
| 285 | - * @param array $query  | 
                                                        |
| 285 | + * @param string $query  | 
                                                        |
| 286 | 286 | * @param string $criteria  | 
                                                        
| 287 | 287 | * @param array $orderBy  | 
                                                        
| 288 | 288 | * @param integer $limit  | 
                                                        
@@ -31,7 +31,6 @@  | 
                                                    ||
| 31 | 31 | use Doctrine\ORM\PersistentCollection;  | 
                                                        
| 32 | 32 | use Doctrine\ORM\EntityManagerInterface;  | 
                                                        
| 33 | 33 | use Doctrine\ORM\Persisters\Entity\EntityPersister;  | 
                                                        
| 34 | -  | 
                                                        |
| 35 | 34 | use Doctrine\Common\Util\ClassUtils;  | 
                                                        
| 36 | 35 | use Doctrine\Common\Collections\Criteria;  | 
                                                        
| 37 | 36 | |
@@ -296,7 +296,7 @@  | 
                                                    ||
| 296 | 296 | ? $this->persister->expandCriteriaParameters($criteria)  | 
                                                        
| 297 | 297 | : $this->persister->expandParameters($criteria);  | 
                                                        
| 298 | 298 | |
| 299 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset);  | 
                                                        |
| 299 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset);  | 
                                                        |
| 300 | 300 | }  | 
                                                        
| 301 | 301 | |
| 302 | 302 | /**  | 
                                                        
@@ -41,9 +41,9 @@ discard block  | 
                                                    ||
| 41 | 41 | */  | 
                                                        
| 42 | 42 | abstract class AbstractEntityPersister implements CachedEntityPersister  | 
                                                        
| 43 | 43 |  { | 
                                                        
| 44 | - /**  | 
                                                        |
| 45 | - * @var \Doctrine\ORM\UnitOfWork  | 
                                                        |
| 46 | - */  | 
                                                        |
| 44 | + /**  | 
                                                        |
| 45 | + * @var \Doctrine\ORM\UnitOfWork  | 
                                                        |
| 46 | + */  | 
                                                        |
| 47 | 47 | protected $uow;  | 
                                                        
| 48 | 48 | |
| 49 | 49 | /**  | 
                                                        
@@ -61,9 +61,9 @@ discard block  | 
                                                    ||
| 61 | 61 | */  | 
                                                        
| 62 | 62 | protected $class;  | 
                                                        
| 63 | 63 | |
| 64 | - /**  | 
                                                        |
| 65 | - * @var array  | 
                                                        |
| 66 | - */  | 
                                                        |
| 64 | + /**  | 
                                                        |
| 65 | + * @var array  | 
                                                        |
| 66 | + */  | 
                                                        |
| 67 | 67 | protected $queuedCache = [];  | 
                                                        
| 68 | 68 | |
| 69 | 69 | /**  | 
                                                        
@@ -49,7 +49,7 @@  | 
                                                    ||
| 49 | 49 | /**  | 
                                                        
| 50 | 50 | * Gets the SQL query.  | 
                                                        
| 51 | 51 | *  | 
                                                        
| 52 | - * @return mixed The built SQL query or an array of all SQL queries.  | 
                                                        |
| 52 | + * @return string The built SQL query or an array of all SQL queries.  | 
                                                        |
| 53 | 53 | *  | 
                                                        
| 54 | 54 | * @override  | 
                                                        
| 55 | 55 | */  | 
                                                        
@@ -579,7 +579,7 @@  | 
                                                    ||
| 579 | 579 | * Internal note: Tried to implement Serializable first but that did not work well  | 
                                                        
| 580 | 580 | * with circular references. This solution seems simpler and works well.  | 
                                                        
| 581 | 581 | *  | 
                                                        
| 582 | - * @return array  | 
                                                        |
| 582 | + * @return string[]  | 
                                                        |
| 583 | 583 | */  | 
                                                        
| 584 | 584 | public function __sleep()  | 
                                                        
| 585 | 585 |      { | 
                                                        
@@ -403,7 +403,7 @@ discard block  | 
                                                    ||
| 403 | 403 | */  | 
                                                        
| 404 | 404 | public function containsKey($key)  | 
                                                        
| 405 | 405 |      { | 
                                                        
| 406 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY  | 
                                                        |
| 406 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY  | 
                                                        |
| 407 | 407 |              && isset($this->association['indexBy'])) { | 
                                                        
| 408 | 408 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);  | 
                                                        
| 409 | 409 | |
@@ -436,7 +436,7 @@ discard block  | 
                                                    ||
| 436 | 436 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY  | 
                                                        
| 437 | 437 | && isset($this->association['indexBy'])  | 
                                                        
| 438 | 438 |          ) { | 
                                                        
| 439 | -            if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { | 
                                                        |
| 439 | +            if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { | 
                                                        |
| 440 | 440 | return $this->em->find($this->typeClass->name, $key);  | 
                                                        
| 441 | 441 | }  | 
                                                        
| 442 | 442 | |
@@ -20,7 +20,6 @@  | 
                                                    ||
| 20 | 20 | namespace Doctrine\ORM\Query;  | 
                                                        
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\ArrayCollection;  | 
                                                        
| 23 | -  | 
                                                        |
| 24 | 23 | use Doctrine\Common\Collections\Expr\ExpressionVisitor;  | 
                                                        
| 25 | 24 | use Doctrine\Common\Collections\Expr\Comparison;  | 
                                                        
| 26 | 25 | use Doctrine\Common\Collections\Expr\CompositeExpression;  | 
                                                        
@@ -114,7 +114,7 @@ discard block  | 
                                                    ||
| 114 | 114 | $expressionList[] = $this->dispatch($child);  | 
                                                        
| 115 | 115 | }  | 
                                                        
| 116 | 116 | |
| 117 | -        switch($expr->getType()) { | 
                                                        |
| 117 | +        switch ($expr->getType()) { | 
                                                        |
| 118 | 118 | case CompositeExpression::TYPE_AND:  | 
                                                        
| 119 | 119 | return new Expr\Andx($expressionList);  | 
                                                        
| 120 | 120 | |
@@ -122,7 +122,7 @@ discard block  | 
                                                    ||
| 122 | 122 | return new Expr\Orx($expressionList);  | 
                                                        
| 123 | 123 | |
| 124 | 124 | default:  | 
                                                        
| 125 | -                throw new \RuntimeException("Unknown composite " . $expr->getType()); | 
                                                        |
| 125 | +                throw new \RuntimeException("Unknown composite ".$expr->getType()); | 
                                                        |
| 126 | 126 | }  | 
                                                        
| 127 | 127 | }  | 
                                                        
| 128 | 128 | |
@@ -136,10 +136,10 @@ discard block  | 
                                                    ||
| 136 | 136 |              throw new QueryException('No aliases are set before invoking walkComparison().'); | 
                                                        
| 137 | 137 | }  | 
                                                        
| 138 | 138 | |
| 139 | - $field = $this->queryAliases[0] . '.' . $comparison->getField();  | 
                                                        |
| 139 | + $field = $this->queryAliases[0].'.'.$comparison->getField();  | 
                                                        |
| 140 | 140 | |
| 141 | -        foreach($this->queryAliases as $alias) { | 
                                                        |
| 142 | -            if(strpos($comparison->getField() . '.', $alias . '.') === 0) { | 
                                                        |
| 141 | +        foreach ($this->queryAliases as $alias) { | 
                                                        |
| 142 | +            if (strpos($comparison->getField().'.', $alias.'.') === 0) { | 
                                                        |
| 143 | 143 | $field = $comparison->getField();  | 
                                                        
| 144 | 144 | break;  | 
                                                        
| 145 | 145 | }  | 
                                                        
@@ -149,13 +149,13 @@ discard block  | 
                                                    ||
| 149 | 149 | |
| 150 | 150 |          foreach ($this->parameters as $parameter) { | 
                                                        
| 151 | 151 |              if ($parameter->getName() === $parameterName) { | 
                                                        
| 152 | - $parameterName .= '_' . count($this->parameters);  | 
                                                        |
| 152 | + $parameterName .= '_'.count($this->parameters);  | 
                                                        |
| 153 | 153 | break;  | 
                                                        
| 154 | 154 | }  | 
                                                        
| 155 | 155 | }  | 
                                                        
| 156 | 156 | |
| 157 | 157 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue()));  | 
                                                        
| 158 | - $placeholder = ':' . $parameterName;  | 
                                                        |
| 158 | + $placeholder = ':'.$parameterName;  | 
                                                        |
| 159 | 159 | |
| 160 | 160 |          switch ($comparison->getOperator()) { | 
                                                        
| 161 | 161 | case Comparison::IN:  | 
                                                        
@@ -182,17 +182,17 @@ discard block  | 
                                                    ||
| 182 | 182 | |
| 183 | 183 | return $this->expr->neq($field, $placeholder);  | 
                                                        
| 184 | 184 | case Comparison::CONTAINS:  | 
                                                        
| 185 | -                $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); | 
                                                        |
| 185 | +                $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); | 
                                                        |
| 186 | 186 | $this->parameters[] = $parameter;  | 
                                                        
| 187 | 187 | |
| 188 | 188 | return $this->expr->like($field, $placeholder);  | 
                                                        
| 189 | 189 | case Comparison::STARTS_WITH:  | 
                                                        
| 190 | - $parameter->setValue($parameter->getValue() . '%', $parameter->getType());  | 
                                                        |
| 190 | + $parameter->setValue($parameter->getValue().'%', $parameter->getType());  | 
                                                        |
| 191 | 191 | $this->parameters[] = $parameter;  | 
                                                        
| 192 | 192 | |
| 193 | 193 | return $this->expr->like($field, $placeholder);  | 
                                                        
| 194 | 194 | case Comparison::ENDS_WITH:  | 
                                                        
| 195 | -                $parameter->setValue('%' . $parameter->getValue(), $parameter->getType()); | 
                                                        |
| 195 | +                $parameter->setValue('%'.$parameter->getValue(), $parameter->getType()); | 
                                                        |
| 196 | 196 | $this->parameters[] = $parameter;  | 
                                                        
| 197 | 197 | |
| 198 | 198 | return $this->expr->like($field, $placeholder);  | 
                                                        
@@ -208,7 +208,7 @@ discard block  | 
                                                    ||
| 208 | 208 | );  | 
                                                        
| 209 | 209 | }  | 
                                                        
| 210 | 210 | |
| 211 | -                throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); | 
                                                        |
| 211 | +                throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); | 
                                                        |
| 212 | 212 | }  | 
                                                        
| 213 | 213 | }  | 
                                                        
| 214 | 214 | |
@@ -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)  | 
                                                        
@@ -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;  | 
                                                        
@@ -21,7 +21,6 @@  | 
                                                    ||
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\ArrayCollection;  | 
                                                        
| 23 | 23 | use Doctrine\Common\Collections\Criteria;  | 
                                                        
| 24 | -  | 
                                                        |
| 25 | 24 | use Doctrine\ORM\Query\Expr;  | 
                                                        
| 26 | 25 | use Doctrine\ORM\Query\QueryExpressionVisitor;  | 
                                                        
| 27 | 26 | |
@@ -606,7 +606,7 @@ discard block  | 
                                                    ||
| 606 | 606 | /**  | 
                                                        
| 607 | 607 | * Gets a (previously set) query parameter of the query being constructed.  | 
                                                        
| 608 | 608 | *  | 
                                                        
| 609 | - * @param mixed $key The key (index or name) of the bound parameter.  | 
                                                        |
| 609 | + * @param string $key The key (index or name) of the bound parameter.  | 
                                                        |
| 610 | 610 | *  | 
                                                        
| 611 | 611 | * @return Query\Parameter|null The value of the bound parameter.  | 
                                                        
| 612 | 612 | */  | 
                                                        
@@ -794,7 +794,7 @@ discard block  | 
                                                    ||
| 794 | 794 |       *         ->leftJoin('u.Phonenumbers', 'p'); | 
                                                        
| 795 | 795 | * </code>  | 
                                                        
| 796 | 796 | *  | 
                                                        
| 797 | - * @param mixed $select The selection expression.  | 
                                                        |
| 797 | + * @param string $select The selection expression.  | 
                                                        |
| 798 | 798 | *  | 
                                                        
| 799 | 799 | * @return self  | 
                                                        
| 800 | 800 | */  | 
                                                        
@@ -1094,7 +1094,6 @@ discard block  | 
                                                    ||
| 1094 | 1094 |       *         ->andWhere('u.is_active = 1'); | 
                                                        
| 1095 | 1095 | * </code>  | 
                                                        
| 1096 | 1096 | *  | 
                                                        
| 1097 | - * @param mixed $where The query restrictions.  | 
                                                        |
| 1098 | 1097 | *  | 
                                                        
| 1099 | 1098 | * @return self  | 
                                                        
| 1100 | 1099 | *  | 
                                                        
@@ -1127,7 +1126,6 @@ discard block  | 
                                                    ||
| 1127 | 1126 |       *         ->orWhere('u.id = 2'); | 
                                                        
| 1128 | 1127 | * </code>  | 
                                                        
| 1129 | 1128 | *  | 
                                                        
| 1130 | - * @param mixed $where The WHERE statement.  | 
                                                        |
| 1131 | 1129 | *  | 
                                                        
| 1132 | 1130 | * @return self  | 
                                                        
| 1133 | 1131 | *  | 
                                                        
@@ -1192,7 +1190,7 @@ discard block  | 
                                                    ||
| 1192 | 1190 | * Specifies a restriction over the groups of the query.  | 
                                                        
| 1193 | 1191 | * Replaces any previous having restrictions, if any.  | 
                                                        
| 1194 | 1192 | *  | 
                                                        
| 1195 | - * @param mixed $having The restriction over the groups.  | 
                                                        |
| 1193 | + * @param string $having The restriction over the groups.  | 
                                                        |
| 1196 | 1194 | *  | 
                                                        
| 1197 | 1195 | * @return self  | 
                                                        
| 1198 | 1196 | */  | 
                                                        
@@ -1209,7 +1207,7 @@ discard block  | 
                                                    ||
| 1209 | 1207 | * Adds a restriction over the groups of the query, forming a logical  | 
                                                        
| 1210 | 1208 | * conjunction with any existing having restrictions.  | 
                                                        
| 1211 | 1209 | *  | 
                                                        
| 1212 | - * @param mixed $having The restriction to append.  | 
                                                        |
| 1210 | + * @param string $having The restriction to append.  | 
                                                        |
| 1213 | 1211 | *  | 
                                                        
| 1214 | 1212 | * @return self  | 
                                                        
| 1215 | 1213 | */  | 
                                                        
@@ -1232,7 +1230,7 @@ discard block  | 
                                                    ||
| 1232 | 1230 | * Adds a restriction over the groups of the query, forming a logical  | 
                                                        
| 1233 | 1231 | * disjunction with any existing having restrictions.  | 
                                                        
| 1234 | 1232 | *  | 
                                                        
| 1235 | - * @param mixed $having The restriction to add.  | 
                                                        |
| 1233 | + * @param string $having The restriction to add.  | 
                                                        |
| 1236 | 1234 | *  | 
                                                        
| 1237 | 1235 | * @return self  | 
                                                        
| 1238 | 1236 | */  | 
                                                        
@@ -1451,7 +1449,7 @@ discard block  | 
                                                    ||
| 1451 | 1449 | /**  | 
                                                        
| 1452 | 1450 | * Resets DQL parts.  | 
                                                        
| 1453 | 1451 | *  | 
                                                        
| 1454 | - * @param array|null $parts  | 
                                                        |
| 1452 | + * @param string[] $parts  | 
                                                        |
| 1455 | 1453 | *  | 
                                                        
| 1456 | 1454 | * @return self  | 
                                                        
| 1457 | 1455 | */  | 
                                                        
@@ -118,11 +118,11 @@ discard block  | 
                                                    ||
| 118 | 118 | */  | 
                                                        
| 119 | 119 | private $joinRootAliases = [];  | 
                                                        
| 120 | 120 | |
| 121 | - /**  | 
                                                        |
| 122 | - * Whether to use second level cache, if available.  | 
                                                        |
| 123 | - *  | 
                                                        |
| 124 | - * @var boolean  | 
                                                        |
| 125 | - */  | 
                                                        |
| 121 | + /**  | 
                                                        |
| 122 | + * Whether to use second level cache, if available.  | 
                                                        |
| 123 | + *  | 
                                                        |
| 124 | + * @var boolean  | 
                                                        |
| 125 | + */  | 
                                                        |
| 126 | 126 | protected $cacheable = false;  | 
                                                        
| 127 | 127 | |
| 128 | 128 | /**  | 
                                                        
@@ -213,10 +213,10 @@ discard block  | 
                                                    ||
| 213 | 213 | }  | 
                                                        
| 214 | 214 | |
| 215 | 215 | /**  | 
                                                        
| 216 | - * Obtain the name of the second level query cache region in which query results will be stored  | 
                                                        |
| 217 | - *  | 
                                                        |
| 218 | - * @return string|null The cache region name; NULL indicates the default region.  | 
                                                        |
| 219 | - */  | 
                                                        |
| 216 | + * Obtain the name of the second level query cache region in which query results will be stored  | 
                                                        |
| 217 | + *  | 
                                                        |
| 218 | + * @return string|null The cache region name; NULL indicates the default region.  | 
                                                        |
| 219 | + */  | 
                                                        |
| 220 | 220 | public function getCacheRegion()  | 
                                                        
| 221 | 221 |      { | 
                                                        
| 222 | 222 | return $this->cacheRegion;  | 
                                                        
@@ -1373,10 +1373,10 @@ discard block  | 
                                                    ||
| 1373 | 1373 | */  | 
                                                        
| 1374 | 1374 | private function _getDQLForDelete()  | 
                                                        
| 1375 | 1375 |      { | 
                                                        
| 1376 | - return 'DELETE'  | 
                                                        |
| 1377 | -              . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) | 
                                                        |
| 1378 | -              . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) | 
                                                        |
| 1379 | -              . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); | 
                                                        |
| 1376 | + return 'DELETE'  | 
                                                        |
| 1377 | +                . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) | 
                                                        |
| 1378 | +                . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) | 
                                                        |
| 1379 | +                . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); | 
                                                        |
| 1380 | 1380 | }  | 
                                                        
| 1381 | 1381 | |
| 1382 | 1382 | /**  | 
                                                        
@@ -1384,11 +1384,11 @@ discard block  | 
                                                    ||
| 1384 | 1384 | */  | 
                                                        
| 1385 | 1385 | private function _getDQLForUpdate()  | 
                                                        
| 1386 | 1386 |      { | 
                                                        
| 1387 | - return 'UPDATE'  | 
                                                        |
| 1388 | -              . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) | 
                                                        |
| 1389 | -              . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) | 
                                                        |
| 1390 | -              . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) | 
                                                        |
| 1391 | -              . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); | 
                                                        |
| 1387 | + return 'UPDATE'  | 
                                                        |
| 1388 | +                . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) | 
                                                        |
| 1389 | +                . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) | 
                                                        |
| 1390 | +                . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) | 
                                                        |
| 1391 | +                . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); | 
                                                        |
| 1392 | 1392 | }  | 
                                                        
| 1393 | 1393 | |
| 1394 | 1394 | /**  | 
                                                        
@@ -1397,8 +1397,8 @@ discard block  | 
                                                    ||
| 1397 | 1397 | private function _getDQLForSelect()  | 
                                                        
| 1398 | 1398 |      { | 
                                                        
| 1399 | 1399 | $dql = 'SELECT'  | 
                                                        
| 1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '')  | 
                                                        |
| 1401 | -             . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); | 
                                                        |
| 1400 | + . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '')  | 
                                                        |
| 1401 | +                . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); | 
                                                        |
| 1402 | 1402 | |
| 1403 | 1403 |          $fromParts   = $this->getDQLPart('from'); | 
                                                        
| 1404 | 1404 |          $joinParts   = $this->getDQLPart('join'); | 
                                                        
@@ -1422,10 +1422,10 @@ discard block  | 
                                                    ||
| 1422 | 1422 | }  | 
                                                        
| 1423 | 1423 | |
| 1424 | 1424 |          $dql .= implode(', ', $fromClauses) | 
                                                        
| 1425 | -              . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) | 
                                                        |
| 1426 | -              . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) | 
                                                        |
| 1427 | -              . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) | 
                                                        |
| 1428 | -              . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); | 
                                                        |
| 1425 | +                . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) | 
                                                        |
| 1426 | +                . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) | 
                                                        |
| 1427 | +                . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) | 
                                                        |
| 1428 | +                . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); | 
                                                        |
| 1429 | 1429 | |
| 1430 | 1430 | return $dql;  | 
                                                        
| 1431 | 1431 | }  | 
                                                        
@@ -1445,8 +1445,8 @@ discard block  | 
                                                    ||
| 1445 | 1445 | }  | 
                                                        
| 1446 | 1446 | |
| 1447 | 1447 | return (isset($options['pre']) ? $options['pre'] : '')  | 
                                                        
| 1448 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)  | 
                                                        |
| 1449 | - . (isset($options['post']) ? $options['post'] : '');  | 
                                                        |
| 1448 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)  | 
                                                        |
| 1449 | + . (isset($options['post']) ? $options['post'] : '');  | 
                                                        |
| 1450 | 1450 | }  | 
                                                        
| 1451 | 1451 | |
| 1452 | 1452 | /**  | 
                                                        
@@ -533,7 +533,7 @@ discard block  | 
                                                    ||
| 533 | 533 | public function setParameter($key, $value, $type = null)  | 
                                                        
| 534 | 534 |      { | 
                                                        
| 535 | 535 | $filteredParameters = $this->parameters->filter(  | 
                                                        
| 536 | - function ($parameter) use ($key)  | 
                                                        |
| 536 | + function($parameter) use ($key)  | 
                                                        |
| 537 | 537 |              { | 
                                                        
| 538 | 538 | /* @var Query\Parameter $parameter */  | 
                                                        
| 539 | 539 | // Must not be identical because of string to integer conversion  | 
                                                        
@@ -614,7 +614,7 @@ discard block  | 
                                                    ||
| 614 | 614 | public function getParameter($key)  | 
                                                        
| 615 | 615 |      { | 
                                                        
| 616 | 616 | $filteredParameters = $this->parameters->filter(  | 
                                                        
| 617 | - function ($parameter) use ($key)  | 
                                                        |
| 617 | + function($parameter) use ($key)  | 
                                                        |
| 618 | 618 |              { | 
                                                        
| 619 | 619 | /* @var Query\Parameter $parameter */  | 
                                                        
| 620 | 620 | // Must not be identical because of string to integer conversion  | 
                                                        
@@ -697,7 +697,7 @@ discard block  | 
                                                    ||
| 697 | 697 | }  | 
                                                        
| 698 | 698 | |
| 699 | 699 | $isMultiple = is_array($this->_dqlParts[$dqlPartName])  | 
                                                        
| 700 | - && !($dqlPartName == 'join' && !$append);  | 
                                                        |
| 700 | + && ! ($dqlPartName == 'join' && ! $append);  | 
                                                        |
| 701 | 701 | |
| 702 | 702 | // Allow adding any part retrieved from self::getDQLParts().  | 
                                                        
| 703 | 703 |          if (is_array($dqlPart) && $dqlPartName != 'join') { | 
                                                        
@@ -914,7 +914,7 @@ discard block  | 
                                                    ||
| 914 | 914 |      { | 
                                                        
| 915 | 915 | $rootAliases = $this->getRootAliases();  | 
                                                        
| 916 | 916 | |
| 917 | -        if (!in_array($alias, $rootAliases)) { | 
                                                        |
| 917 | +        if ( ! in_array($alias, $rootAliases)) { | 
                                                        |
| 918 | 918 | throw new Query\QueryException(  | 
                                                        
| 919 | 919 |                  sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) | 
                                                        
| 920 | 920 | );  | 
                                                        
@@ -1316,15 +1316,15 @@ discard block  | 
                                                    ||
| 1316 | 1316 |              foreach ($criteria->getOrderings() as $sort => $order) { | 
                                                        
| 1317 | 1317 | |
| 1318 | 1318 | $hasValidAlias = false;  | 
                                                        
| 1319 | -                foreach($allAliases as $alias) { | 
                                                        |
| 1320 | -                    if(strpos($sort . '.', $alias . '.') === 0) { | 
                                                        |
| 1319 | +                foreach ($allAliases as $alias) { | 
                                                        |
| 1320 | +                    if (strpos($sort.'.', $alias.'.') === 0) { | 
                                                        |
| 1321 | 1321 | $hasValidAlias = true;  | 
                                                        
| 1322 | 1322 | break;  | 
                                                        
| 1323 | 1323 | }  | 
                                                        
| 1324 | 1324 | }  | 
                                                        
| 1325 | 1325 | |
| 1326 | -                if(!$hasValidAlias) { | 
                                                        |
| 1327 | - $sort = $allAliases[0] . '.' . $sort;  | 
                                                        |
| 1326 | +                if ( ! $hasValidAlias) { | 
                                                        |
| 1327 | + $sort = $allAliases[0].'.'.$sort;  | 
                                                        |
| 1328 | 1328 | }  | 
                                                        
| 1329 | 1329 | |
| 1330 | 1330 | $this->addOrderBy($sort, $order);  | 
                                                        
@@ -1397,7 +1397,7 @@ discard block  | 
                                                    ||
| 1397 | 1397 | private function _getDQLForSelect()  | 
                                                        
| 1398 | 1398 |      { | 
                                                        
| 1399 | 1399 | $dql = 'SELECT'  | 
                                                        
| 1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '')  | 
                                                        |
| 1400 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '')  | 
                                                        |
| 1401 | 1401 |               . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); | 
                                                        
| 1402 | 1402 | |
| 1403 | 1403 |          $fromParts   = $this->getDQLPart('from'); | 
                                                        
@@ -1413,7 +1413,7 @@ discard block  | 
                                                    ||
| 1413 | 1413 | |
| 1414 | 1414 |                  if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { | 
                                                        
| 1415 | 1415 |                      foreach ($joinParts[$from->getAlias()] as $join) { | 
                                                        
| 1416 | - $fromClause .= ' ' . ((string) $join);  | 
                                                        |
| 1416 | + $fromClause .= ' '.((string) $join);  | 
                                                        |
| 1417 | 1417 | }  | 
                                                        
| 1418 | 1418 | }  | 
                                                        
| 1419 | 1419 | |
@@ -12,11 +12,11 @@  | 
                                                    ||
| 12 | 12 | use Entities\Address;  | 
                                                        
| 13 | 13 | use Entities\User;  | 
                                                        
| 14 | 14 | |
| 15 | -$em = require_once __DIR__ . '/bootstrap.php';  | 
                                                        |
| 15 | +$em = require_once __DIR__.'/bootstrap.php';  | 
                                                        |
| 16 | 16 | |
| 17 | 17 | ## PUT YOUR TEST CODE BELOW  | 
                                                        
| 18 | 18 | |
| 19 | 19 | $user = new User;  | 
                                                        
| 20 | 20 | $address = new Address;  | 
                                                        
| 21 | 21 | |
| 22 | -echo 'Hello World!' . PHP_EOL;  | 
                                                        |
| 22 | +echo 'Hello World!'.PHP_EOL;  | 
                                                        |
@@ -35,7 +35,7 @@  | 
                                                    ||
| 35 | 35 | public function generate(EntityManager $em, $entity)  | 
                                                        
| 36 | 36 |      { | 
                                                        
| 37 | 37 | $conn = $em->getConnection();  | 
                                                        
| 38 | - $sql = 'SELECT ' . $conn->getDatabasePlatform()->getGuidExpression();  | 
                                                        |
| 38 | + $sql = 'SELECT '.$conn->getDatabasePlatform()->getGuidExpression();  | 
                                                        |
| 39 | 39 | |
| 40 | 40 | return $conn->query($sql)->fetchColumn(0);  | 
                                                        
| 41 | 41 | }  |