@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | $time = microtime(true) - $start; |
| 251 | 251 | if ($input->getOption('separate-process')) { |
| 252 | 252 | // in case of using subprocesses, we can not measure max memory used |
| 253 | - $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs</info>"); |
|
| 253 | + $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs</info>"); |
|
| 254 | 254 | } else { |
| 255 | - $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB</info>'); |
|
| 255 | + $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB</info>'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | return $failed; |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | $builderArgs[] = '--no-debug'; |
| 485 | 485 | } |
| 486 | 486 | if ($input->getOption('siteaccess')) { |
| 487 | - $builderArgs[] = '--siteaccess='.$input->getOption('siteaccess'); |
|
| 487 | + $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess'); |
|
| 488 | 488 | } |
| 489 | 489 | switch ($this->verbosity) { |
| 490 | 490 | case OutputInterface::VERBOSITY_VERBOSE: |
@@ -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; |
@@ -204,14 +204,14 @@ discard block |
||
| 204 | 204 | $i = 0; |
| 205 | 205 | foreach ($contentVersions as $versionKey => $versionInfo) { |
| 206 | 206 | foreach ($values as $acceptedVersionNo) { |
| 207 | - if ($acceptedVersionNo > 0 ) { |
|
| 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 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | return new Query\Criterion\Field($attribute, self::$operatorsMap[$operator], $match); |
| 156 | 156 | } else { |
| 157 | 157 | /// @todo make the list of unary operators more flexible |
| 158 | - switch($spec) { |
|
| 158 | + switch ($spec) { |
|
| 159 | 159 | case 'empty': |
| 160 | 160 | return new Query\Criterion\IsFieldEmpty($attribute); |
| 161 | 161 | default: |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $direction = $this->hash2SortOrder($sortItem['sort_order']); |
| 303 | 303 | |
| 304 | - switch($sortItem['sort_field']) { |
|
| 304 | + switch ($sortItem['sort_field']) { |
|
| 305 | 305 | case self::SORT_CONTENT_ID: |
| 306 | 306 | $out[] = new SortClause\ContentId($direction); |
| 307 | 307 | break; |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $users = []; |
| 112 | 112 | |
| 113 | 113 | foreach ($userIds as $userId) { |
| 114 | - try{ |
|
| 114 | + try { |
|
| 115 | 115 | // return unique contents |
| 116 | 116 | $user = $this->repository->getUserService()->loadUser($userId); |
| 117 | 117 | |
@@ -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( |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | |
| 171 | 171 | foreach ($dsl['references'] as $key => $reference) { |
| 172 | 172 | // BC |
| 173 | - if (is_array($reference) && isset($reference['json_path']) && !isset($reference['attribute'] )) { |
|
| 173 | + if (is_array($reference) && isset($reference['json_path']) && !isset($reference['attribute'])) { |
|
| 174 | 174 | $reference['attribute'] = $reference['json_path']; |
| 175 | 175 | } |
| 176 | 176 | $reference = $this->parseReferenceDefinition($key, $reference); |
@@ -778,7 +778,7 @@ |
||
| 778 | 778 | }, |
| 779 | 779 | array_filter( |
| 780 | 780 | $this->repository->getContentLanguageService()->loadLanguages(), |
| 781 | - function ($language) { |
|
| 781 | + function($language) { |
|
| 782 | 782 | return $language->enabled; |
| 783 | 783 | } |
| 784 | 784 | ) |
@@ -268,10 +268,10 @@ |
||
| 268 | 268 | $names = array(); |
| 269 | 269 | $descriptions = array(); |
| 270 | 270 | foreach ($objectState->languageCodes as $languageCode) { |
| 271 | - $names[$languageCode] = $objectState->getName($languageCode); |
|
| 271 | + $names[$languageCode] = $objectState->getName($languageCode); |
|
| 272 | 272 | } |
| 273 | 273 | foreach ($objectState->languageCodes as $languageCode) { |
| 274 | - $descriptions[$languageCode] = $objectState->getDescription($languageCode); |
|
| 274 | + $descriptions[$languageCode] = $objectState->getDescription($languageCode); |
|
| 275 | 275 | } |
| 276 | 276 | $groupData = array_merge( |
| 277 | 277 | $groupData, |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | $step = new MigrationStep($dsl['type'], $dsl, $context); |
| 149 | 149 | |
| 150 | - switch($dsl['type']) { |
|
| 150 | + switch ($dsl['type']) { |
|
| 151 | 151 | case 'content': |
| 152 | 152 | return $this->contentManager->execute($step); |
| 153 | 153 | case 'location': |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | return $this->matchConditions($values); |
| 179 | 179 | |
| 180 | 180 | default: |
| 181 | - throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration ".var_export($conditions, true)); |
|
| 181 | + throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration " . var_export($conditions, true)); |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | } |