@@ -132,7 +132,7 @@ |
||
| 132 | 132 | $refs = array(); |
| 133 | 133 | |
| 134 | 134 | foreach ($this->resolvers as $resolver) { |
| 135 | - if (! $resolver instanceof EnumerableReferenceResolverInterface) { |
|
| 135 | + if (!$resolver instanceof EnumerableReferenceResolverInterface) { |
|
| 136 | 136 | // Disabled - we now allow chaining enumerable and non-enumerable sets |
| 137 | 137 | //throw new MigrationBundleException("Could not enumerate references because of chained resolver of type: " . get_class($resolver)); |
| 138 | 138 | continue; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | throw new MigrationBundleException("Invalid step definition: file '$fileName' for saving references already exists"); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if (! $this->referenceResolver instanceof EnumerableReferenceResolverInterface) { |
|
| 166 | + if (!$this->referenceResolver instanceof EnumerableReferenceResolverInterface) { |
|
| 167 | 167 | throw new MigrationBundleException("Can not save references as resolver is not enumerable"); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $value = $this->dumpVar($this->referenceResolver->resolveReference($dsl['identifier'])); |
| 209 | 209 | |
| 210 | 210 | if (isset($context['output']) && $context['output'] instanceof OutputInterface) { |
| 211 | - $context['output']->write($label . $value, false, OutputInterface::OUTPUT_RAW|OutputInterface::VERBOSITY_NORMAL); |
|
| 211 | + $context['output']->write($label . $value, false, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_NORMAL); |
|
| 212 | 212 | } else { |
| 213 | 213 | echo $label . $value; |
| 214 | 214 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | $dumper->dump( |
| 232 | 232 | $cloner->cloneVar($var), |
| 233 | - function ($line, $depth) use (&$output) { |
|
| 233 | + function($line, $depth) use (&$output) { |
|
| 234 | 234 | // A negative depth means "end of dump" |
| 235 | 235 | if ($depth >= 0) { |
| 236 | 236 | // Adds a two spaces indentation to the line |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | public function endMigration(APIMigration $migration, $force = false) |
| 207 | 207 | { |
| 208 | 208 | if ($migration->status == APIMigration::STATUS_STARTED) { |
| 209 | - throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be ended as its status is 'started'..."); |
|
| 209 | + throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be ended as its status is 'started'..."); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $this->createTableIfNeeded(); |
@@ -233,13 +233,13 @@ discard block |
||
| 233 | 233 | if (!is_array($existingMigrationData)) { |
| 234 | 234 | // commit to release the lock |
| 235 | 235 | $conn->commit(); |
| 236 | - throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not found"); |
|
| 236 | + throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not found"); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | if (($existingMigrationData['status'] != APIMigration::STATUS_STARTED) && !$force) { |
| 240 | 240 | // commit to release the lock |
| 241 | 241 | $conn->commit(); |
| 242 | - throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not executing"); |
|
| 242 | + throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not executing"); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $conn->update( |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | if (!is_array($existingMigrationData)) { |
| 396 | 396 | // commit immediately, to release the lock and avoid deadlocks |
| 397 | 397 | $conn->commit(); |
| 398 | - throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not found"); |
|
| 398 | + throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not found"); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | // migration exists |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | if ($existingMigrationData['status'] != APIMigration::STATUS_SUSPENDED) { |
| 405 | 405 | // commit to release the lock |
| 406 | 406 | $conn->commit(); |
| 407 | - throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not suspended"); |
|
| 407 | + throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not suspended"); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | $migration = new APIMigration( |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | foreach ($schema->toSql($dbPlatform) as $sql) { |
| 467 | 467 | try { |
| 468 | 468 | $this->dbHandler->exec($sql); |
| 469 | - } catch(QueryException $e) { |
|
| 469 | + } catch (QueryException $e) { |
|
| 470 | 470 | // work around limitations in both Mysql and Doctrine |
| 471 | 471 | // @see https://github.com/kaliop-uk/ezmigrationbundle/issues/176 |
| 472 | 472 | if (strpos($e->getMessage(), '1071 Specified key was too long; max key length is 767 bytes') !== false && |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function storeCurrentContext($migrationName) |
| 37 | 37 | { |
| 38 | 38 | $context = array(); |
| 39 | - foreach($this->providers as $label => $provider) { |
|
| 39 | + foreach ($this->providers as $label => $provider) { |
|
| 40 | 40 | $context[$label] = $provider->getCurrentContext($migrationName); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | if (!is_array($context)) { |
| 54 | 54 | throw new MigrationBundleException("No execution context found associated with migration '$migrationName'"); |
| 55 | 55 | } |
| 56 | - foreach($this->providers as $label => $provider) { |
|
| 56 | + foreach ($this->providers as $label => $provider) { |
|
| 57 | 57 | if (isset($context[$label])) { |
| 58 | 58 | $provider->restoreContext($migrationName, $context[$label]); |
| 59 | 59 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function setReferenceResolver(ReferenceResolverInterface $referenceResolver) |
| 13 | 13 | { |
| 14 | - if (! $referenceResolver instanceof EmbeddedReferenceResolverInterface) { |
|
| 14 | + if (!$referenceResolver instanceof EmbeddedReferenceResolverInterface) { |
|
| 15 | 15 | throw new MigrationBundleException("Reference resolver injected into EzRichText field handler should implement EmbeddedReferenceResolverInterface"); |
| 16 | 16 | } |
| 17 | 17 | parent::setReferenceResolver($referenceResolver); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function setReferenceResolver(ReferenceResolverInterface $referenceResolver) |
| 14 | 14 | { |
| 15 | - if (! $referenceResolver instanceof EmbeddedReferenceResolverInterface) { |
|
| 15 | + if (!$referenceResolver instanceof EmbeddedReferenceResolverInterface) { |
|
| 16 | 16 | throw new MigrationBundleException("Reference resolver injected into EzXmlText field handler should implement EmbeddedReferenceResolverInterface"); |
| 17 | 17 | } |
| 18 | 18 | parent::setReferenceResolver($referenceResolver); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace Kaliop\eZMigrationBundle\Core\Matcher; |
| 4 | 4 | |
| 5 | -use eZ\Publish\API\Repository\Exceptions\UnauthorizedException ; |
|
| 5 | +use eZ\Publish\API\Repository\Exceptions\UnauthorizedException; |
|
| 6 | 6 | use eZ\Publish\API\Repository\Repository; |
| 7 | 7 | use eZ\Publish\API\Repository\Values\Content\Content; |
| 8 | 8 | use eZ\Publish\API\Repository\Values\Content\VersionInfo; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $versions = array(); |
| 58 | 58 | |
| 59 | 59 | $contentCollection = $this->contentMatcher->match($contentConditions, $sort, $offset, $limit, $tolerateMisses); |
| 60 | - foreach($contentCollection as $content) { |
|
| 60 | + foreach ($contentCollection as $content) { |
|
| 61 | 61 | $versions = array_merge($versions, $this->matchContentVersions($versionConditions, $content)); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $versions = array(); |
| 181 | 181 | foreach ($this->findAllContentVersions($content) as $versionKey => $versionInfo) { |
| 182 | - foreach($values as $acceptedStatus) { |
|
| 182 | + foreach ($values as $acceptedStatus) { |
|
| 183 | 183 | if ($versionInfo->status == self::STATUS_MAP[$acceptedStatus]) { |
| 184 | 184 | $versions[$versionKey] = $versionInfo; |
| 185 | 185 | break; |
@@ -203,15 +203,15 @@ discard block |
||
| 203 | 203 | $contentVersionsCount = count($contentVersions); |
| 204 | 204 | $i = 0; |
| 205 | 205 | foreach ($contentVersions as $versionKey => $versionInfo) { |
| 206 | - foreach($values as $acceptedVersionNo) { |
|
| 207 | - if ($acceptedVersionNo > 0 ) { |
|
| 206 | + foreach ($values as $acceptedVersionNo) { |
|
| 207 | + if ($acceptedVersionNo > 0) { |
|
| 208 | 208 | if ($acceptedVersionNo == $versionInfo->versionNo) { |
| 209 | 209 | $versions[$versionKey] = $versionInfo; |
| 210 | 210 | break; |
| 211 | 211 | } |
| 212 | 212 | } else { |
| 213 | 213 | // negative $acceptedVersionNo means 'leave the last X versions', eg: -1 = leave the last version |
| 214 | - if ($i < $contentVersionsCount + $acceptedVersionNo) { |
|
| 214 | + if ($i < $contentVersionsCount + $acceptedVersionNo) { |
|
| 215 | 215 | $versions[$versionKey] = $versionInfo; |
| 216 | 216 | break; |
| 217 | 217 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $contentVersions = $this->repository->getContentService()->loadVersions($content->contentInfo); |
| 234 | 234 | // different eZ kernels apparently sort versions in different order... |
| 235 | 235 | $sortedVersions = array(); |
| 236 | - foreach($contentVersions as $versionInfo) { |
|
| 236 | + foreach ($contentVersions as $versionInfo) { |
|
| 237 | 237 | $sortedVersions[$content->contentInfo->id . '/' . $versionInfo->versionNo] = $versionInfo; |
| 238 | 238 | } |
| 239 | 239 | ksort($sortedVersions); |