@@ -107,7 +107,9 @@ discard block |
||
107 | 107 | if (!empty($sort)) { |
108 | 108 | $query->sortClauses = $this->getSortClauses($sort); |
109 | 109 | } |
110 | - if (isset($query->performCount)) $query->performCount = false; |
|
110 | + if (isset($query->performCount)) { |
|
111 | + $query->performCount = false; |
|
112 | + } |
|
111 | 113 | |
112 | 114 | $results = $this->getSearchService()->findLocations($query); |
113 | 115 | |
@@ -254,7 +256,9 @@ discard block |
||
254 | 256 | { |
255 | 257 | $query = new LocationQuery(); |
256 | 258 | $query->limit = self::INT_MAX_16BIT; |
257 | - if (isset($query->performCount)) $query->performCount = false; |
|
259 | + if (isset($query->performCount)) { |
|
260 | + $query->performCount = false; |
|
261 | + } |
|
258 | 262 | $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds); |
259 | 263 | |
260 | 264 | $results = $this->getSearchService()->findLocations($query); |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | } |
85 | 85 | if (is_array($paths) && count($paths)) { |
86 | 86 | $pexps = array(); |
87 | - foreach($paths as $path) { |
|
87 | + foreach ($paths as $path) { |
|
88 | 88 | /// @todo use a proper db-aware escaping function |
89 | - $pexps[] = $q->expr->like('path', "'" . str_replace(array('_', '%', "'"), array('\_', '\%', "''"), $path).'%' . "'"); |
|
89 | + $pexps[] = $q->expr->like('path', "'" . str_replace(array('_', '%', "'"), array('\_', '\%', "''"), $path) . '%' . "'"); |
|
90 | 90 | } |
91 | 91 | $exps[] = $q->expr->lor($pexps); |
92 | 92 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | public function endMigration(APIMigration $migration, $force = false) |
197 | 197 | { |
198 | 198 | if ($migration->status == APIMigration::STATUS_STARTED) { |
199 | - throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be ended as its status is 'started'..."); |
|
199 | + throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be ended as its status is 'started'..."); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | $this->createTableIfNeeded(); |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | if (!is_array($existingMigrationData)) { |
224 | 224 | // commit to release the lock |
225 | 225 | $conn->commit(); |
226 | - throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not found"); |
|
226 | + throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not found"); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | if (($existingMigrationData['status'] != APIMigration::STATUS_STARTED) && !$force) { |
230 | 230 | // commit to release the lock |
231 | 231 | $conn->commit(); |
232 | - throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not executing"); |
|
232 | + throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not executing"); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $conn->update( |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | if (!is_array($existingMigrationData)) { |
385 | 385 | // commit immediately, to release the lock and avoid deadlocks |
386 | 386 | $conn->commit(); |
387 | - throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not found"); |
|
387 | + throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not found"); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | // migration exists |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | if ($existingMigrationData['status'] != APIMigration::STATUS_SUSPENDED) { |
394 | 394 | // commit to release the lock |
395 | 395 | $conn->commit(); |
396 | - throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not suspended"); |
|
396 | + throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not suspended"); |
|
397 | 397 | } |
398 | 398 | |
399 | 399 | $migration = new APIMigration( |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | foreach ($schema->toSql($dbPlatform) as $sql) { |
456 | 456 | try { |
457 | 457 | $this->dbHandler->exec($sql); |
458 | - } catch(QueryException $e) { |
|
458 | + } catch (QueryException $e) { |
|
459 | 459 | // work around limitations in both Mysql and Doctrine |
460 | 460 | // @see https://github.com/kaliop-uk/ezmigrationbundle/issues/176 |
461 | 461 | if (strpos($e->getMessage(), '1071 Specified key was too long; max key length is 767 bytes') !== false && |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | |
25 | 25 | if ($this->usingLegacyFieldType()) { |
26 | 26 | $rows = array(); |
27 | - foreach($fieldValue as $data) { |
|
27 | + foreach ($fieldValue as $data) { |
|
28 | 28 | $rows[] = new \EzSystems\MatrixBundle\FieldType\Matrix\Row($data); |
29 | 29 | } |
30 | 30 | return new \EzSystems\MatrixBundle\FieldType\Matrix\Value($rows); |
31 | 31 | } else { |
32 | 32 | $rows = array(); |
33 | - foreach($fieldValue as $data) { |
|
33 | + foreach ($fieldValue as $data) { |
|
34 | 34 | $rows[] = new \EzSystems\EzPlatformMatrixFieldtype\FieldType\Value\Row($data); |
35 | 35 | } |
36 | 36 | return new \EzSystems\EzPlatformMatrixFieldtype\FieldType\Value($rows); |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | $data = array(); |
43 | 43 | |
44 | 44 | if ($this->usingLegacyFieldType()) { |
45 | - foreach($fieldValue->getRows() as $row) { |
|
45 | + foreach ($fieldValue->getRows() as $row) { |
|
46 | 46 | $data[] = $row->toArray(); |
47 | 47 | } |
48 | 48 | } else { |
49 | - foreach($fieldValue->getRows() as $row) { |
|
49 | + foreach ($fieldValue->getRows() as $row) { |
|
50 | 50 | $data[] = $row->getCells(); |
51 | 51 | } |
52 | 52 | } |