@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // return unique contents |
| 109 | 109 | $contentType = $this->repository->getContentTypeService()->loadContentType($contentTypeId); |
| 110 | 110 | $contentTypes[$contentType->id] = $contentType; |
| 111 | - } catch(NotFoundException $e) { |
|
| 111 | + } catch (NotFoundException $e) { |
|
| 112 | 112 | if (!$tolerateMisses) { |
| 113 | 113 | throw $e; |
| 114 | 114 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | // return unique contents |
| 134 | 134 | $contentType = $this->repository->getContentTypeService()->loadContentTypeByIdentifier($contentTypeIdentifier); |
| 135 | 135 | $contentTypes[$contentType->id] = $contentType; |
| 136 | - } catch(NotFoundException $e) { |
|
| 136 | + } catch (NotFoundException $e) { |
|
| 137 | 137 | if (!$tolerateMisses) { |
| 138 | 138 | throw $e; |
| 139 | 139 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | // return unique contents |
| 158 | 158 | $contentType = $this->repository->getContentTypeService()->loadContentTypeByRemoteId($contentTypeRemoteId); |
| 159 | 159 | $contentTypes[$contentType->id] = $contentType; |
| 160 | - } catch(NotFoundException $e) { |
|
| 160 | + } catch (NotFoundException $e) { |
|
| 161 | 161 | if (!$tolerateMisses) { |
| 162 | 162 | throw $e; |
| 163 | 163 | } |
@@ -117,13 +117,13 @@ discard block |
||
| 117 | 117 | $dsl['mode'] = 'load'; |
| 118 | 118 | // be kind to users and allow them not to specify this explicitly |
| 119 | 119 | if (isset($dsl['references'])) { |
| 120 | - foreach($dsl['references'] as &$refDef) { |
|
| 120 | + foreach ($dsl['references'] as &$refDef) { |
|
| 121 | 121 | $refDef['overwrite'] = true; |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | $step = new MigrationStep($dsl['type'], $dsl, $context); |
| 125 | 125 | |
| 126 | - switch($dsl['type']) { |
|
| 126 | + switch ($dsl['type']) { |
|
| 127 | 127 | case 'content': |
| 128 | 128 | return $this->contentManager->execute($step); |
| 129 | 129 | case 'location': |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | return $this->matchConditions($values); |
| 155 | 155 | |
| 156 | 156 | default: |
| 157 | - throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration ".var_export($conditions, true)); |
|
| 157 | + throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration " . var_export($conditions, true)); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | foreach ($schema->toSql($dbPlatform) as $sql) { |
| 124 | 124 | try { |
| 125 | 125 | $this->dbHandler->exec($sql); |
| 126 | - } catch(QueryException $e) { |
|
| 126 | + } catch (QueryException $e) { |
|
| 127 | 127 | // work around limitations in both Mysql and Doctrine |
| 128 | 128 | // @see https://github.com/kaliop-uk/ezmigrationbundle/issues/176 |
| 129 | 129 | if (strpos($e->getMessage(), '1071 Specified key was too long; max key length is 767 bytes') !== false && |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | protected function injectTableCreationOptions(Table $table) |
| 55 | 55 | { |
| 56 | - foreach($this->tableCreationOptions as $key => $value) { |
|
| 56 | + foreach ($this->tableCreationOptions as $key => $value) { |
|
| 57 | 57 | $table->addOption($key, $value); |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | if (is_string($key) && is_string($value)) { |
| 47 | 47 | return array('identifier' => $key, 'attribute' => $value); |
| 48 | 48 | } |
| 49 | - if (!is_array($value) || !isset($value['identifier']) || ! isset($value['attribute'])) { |
|
| 49 | + if (!is_array($value) || !isset($value['identifier']) || !isset($value['attribute'])) { |
|
| 50 | 50 | throw new InvalidStepDefinitionException("Invalid reference definition for reference number $key"); |
| 51 | 51 | } |
| 52 | 52 | return $value; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // q2: why not just check for Countable interface instead of AbstractCollection? Or at least allow ArrayIterators and ObjectIterators |
| 38 | 38 | if (is_array($results) || $results instanceof AbstractCollection) { |
| 39 | 39 | $expectedResultsCount = $this->expectedResultsCount($step); |
| 40 | - switch($expectedResultsCount) { |
|
| 40 | + switch ($expectedResultsCount) { |
|
| 41 | 41 | case self::$EXPECT_UNSPECIFIED: |
| 42 | 42 | case self::$EXPECT_ANY: |
| 43 | 43 | break; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | protected function expectedResultsType($step) |
| 64 | 64 | { |
| 65 | - switch($this->expectedResultsCount($step)) { |
|
| 65 | + switch ($this->expectedResultsCount($step)) { |
|
| 66 | 66 | case 1: |
| 67 | 67 | return self::$RESULT_TYPE_SINGLE; |
| 68 | 68 | case 0: |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | // BC |
| 106 | 106 | if (isset($step->dsl['references_type'])) { |
| 107 | - switch($step->dsl['references_type']) { |
|
| 107 | + switch ($step->dsl['references_type']) { |
|
| 108 | 108 | case 'array': |
| 109 | 109 | return self::$EXPECT_ANY; |
| 110 | 110 | case 'scalar': |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | protected function hasNonScalarReferences($referencesDefinition) |
| 132 | 132 | { |
| 133 | - foreach($referencesDefinition as $key => $referenceDefinition) { |
|
| 133 | + foreach ($referencesDefinition as $key => $referenceDefinition) { |
|
| 134 | 134 | $referenceDefinition = $this->parseReferenceDefinition($key, $referenceDefinition); |
| 135 | 135 | if (!$this->isScalarReference($referenceDefinition)) |
| 136 | 136 | { |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | protected function sortPolicyLimitationsDefinitions(array &$limitations) |
| 445 | 445 | { |
| 446 | 446 | usort($limitations, function($l1, $l2) { |
| 447 | - if (($iComp = strcmp($l1['identifier'], $l2['identifier'])) != 0 ) { |
|
| 447 | + if (($iComp = strcmp($l1['identifier'], $l2['identifier'])) != 0) { |
|
| 448 | 448 | return $iComp; |
| 449 | 449 | } |
| 450 | 450 | if (is_int($l1['values']) || is_float($l1['values'])) { |
@@ -473,10 +473,10 @@ discard block |
||
| 473 | 473 | return $this->compareArraysForSorting($p1['limitations'], $p2['limitations']); |
| 474 | 474 | $p1LimIds = array(); |
| 475 | 475 | $p2LimIds = array(); |
| 476 | - foreach($p1['limitations'] as $lim) { |
|
| 476 | + foreach ($p1['limitations'] as $lim) { |
|
| 477 | 477 | $p1LimIds = $lim['identifier']; |
| 478 | 478 | } |
| 479 | - foreach($p2['limitations'] as $lim) { |
|
| 479 | + foreach ($p2['limitations'] as $lim) { |
|
| 480 | 480 | $p2LimIds = $lim['identifier']; |
| 481 | 481 | } |
| 482 | 482 | /// @todo if limitations identifier are the same, sort by lim. values... |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | foreach ($dsl['references'] as $key => $reference) { |
| 170 | 170 | // BC |
| 171 | - if (is_array($reference) && isset($reference['json_path']) && !isset($reference['attribute'] )) { |
|
| 171 | + if (is_array($reference) && isset($reference['json_path']) && !isset($reference['attribute'])) { |
|
| 172 | 172 | $reference['attribute'] = $reference['json_path']; |
| 173 | 173 | } |
| 174 | 174 | $reference = $this->parseReferenceDefinition($key, $reference); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | { |
| 198 | 198 | $migrationService = $this->migrationService; |
| 199 | 199 | $executors = $migrationService->listExecutors(); |
| 200 | - foreach($executors as $key => $name) { |
|
| 200 | + foreach ($executors as $key => $name) { |
|
| 201 | 201 | $executor = $migrationService->getExecutor($name); |
| 202 | 202 | if (!$executor instanceof MigrationGeneratorInterface) { |
| 203 | 203 | unset($executors[$key]); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | $multivalued = ($this->expectedResultsType($step) == self::$RESULT_TYPE_MULTIPLE); |
| 218 | 218 | |
| 219 | - if ($item instanceof AbstractCollection || is_array($item)) { |
|
| 219 | + if ($item instanceof AbstractCollection || is_array($item)) { |
|
| 220 | 220 | $items = $item; |
| 221 | 221 | } else { |
| 222 | 222 | $items = array($item); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | // allow setting *some* refs even when we have 0 or N matches |
| 262 | 262 | foreach ($referencesDefinition as $key => $reference) { |
| 263 | 263 | $reference = $this->parseReferenceDefinition($key, $reference); |
| 264 | - switch($reference['attribute']) { |
|
| 264 | + switch ($reference['attribute']) { |
|
| 265 | 265 | |
| 266 | 266 | case 'count': |
| 267 | 267 | $value = count($entity); |