@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $builderArgs[] = '--no-transactions'; |
| 125 | 125 | } |
| 126 | 126 | if ($input->getOption('siteaccess')) { |
| 127 | - $builderArgs[]='--siteaccess='.$input->getOption('siteaccess'); |
|
| 127 | + $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess'); |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | $this->writeln("Executed $executed migrations, failed $failed, skipped $skipped"); |
| 234 | 234 | if ($input->getOption('separate-process')) { |
| 235 | 235 | // in case of using subprocesses, we can not measure max memory used |
| 236 | - $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs"); |
|
| 236 | + $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs"); |
|
| 237 | 237 | } else { |
| 238 | - $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB'); |
|
| 238 | + $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB'); |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
| 262 | - throw new \Exception("Can not execute " . $this->getEntityName($migrationDefinition). " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}"); |
|
| 262 | + throw new \Exception("Can not execute " . $this->getEntityName($migrationDefinition) . " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}"); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /// @todo add support for setting in $migrationContext a userContentType ? |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | try { |
| 295 | 295 | |
| 296 | - $i = $stepOffset+1; |
|
| 296 | + $i = $stepOffset + 1; |
|
| 297 | 297 | $finalStatus = Migration::STATUS_DONE; |
| 298 | 298 | $finalMessage = null; |
| 299 | 299 | |
@@ -418,12 +418,12 @@ discard block |
||
| 418 | 418 | public function resumeMigration(Migration $migration, $useTransaction = true) |
| 419 | 419 | { |
| 420 | 420 | if ($migration->status != Migration::STATUS_SUSPENDED) { |
| 421 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': it is not in suspended status"); |
|
| 421 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': it is not in suspended status"); |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | $migrationDefinitions = $this->getMigrationsDefinitions(array($migration->path)); |
| 425 | 425 | if (!count($migrationDefinitions)) { |
| 426 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': its definition is missing"); |
|
| 426 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': its definition is missing"); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | $defs = $migrationDefinitions->getArrayCopy(); |
@@ -431,18 +431,18 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | $migrationDefinition = $this->parseMigrationDefinition($migrationDefinition); |
| 433 | 433 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
| 434 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': {$migrationDefinition->parsingError}"); |
|
| 434 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': {$migrationDefinition->parsingError}"); |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | // restore context |
| 438 | 438 | $this->contextHandler->restoreCurrentContext($migration->name); |
| 439 | 439 | |
| 440 | 440 | if (!isset($this->migrationContext[$migration->name])) { |
| 441 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is missing"); |
|
| 441 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is missing"); |
|
| 442 | 442 | } |
| 443 | 443 | $restoredContext = $this->migrationContext[$migration->name]; |
| 444 | - if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'] )) { |
|
| 445 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is invalid"); |
|
| 444 | + if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'])) { |
|
| 445 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is invalid"); |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | // update migration status |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | } else { |
| 75 | 75 | $args = array(); |
| 76 | 76 | } |
| 77 | - foreach($args as &$val) { |
|
| 77 | + foreach ($args as &$val) { |
|
| 78 | 78 | $val = $this->resolveReferencesRecursively($val); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function hasEmbeddedReferences($string) |
| 19 | 19 | { |
| 20 | 20 | $regexp = $this->getEmbeddedRegexp(); |
| 21 | - return (bool) preg_match_all($regexp, $string, $matches); |
|
| 21 | + return (bool)preg_match_all($regexp, $string, $matches); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | // we need to alter the regexp we usr for std ref resolving, as it will be used to match parts of text, not the whole string |
| 54 | 54 | $regexp = substr($this->getRegexp(), 1, -1); |
| 55 | - return '/' . preg_quote($this->beginToken). preg_replace(array('/^\^/'), array(''), $regexp) . '[^' . $this->endToken . ']+' . preg_quote($this->endToken) . '/'; |
|
| 55 | + return '/' . preg_quote($this->beginToken) . preg_replace(array('/^\^/'), array(''), $regexp) . '[^' . $this->endToken . ']+' . preg_quote($this->endToken) . '/'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -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 \Exception("Reference resolver injected into EzRichText field handler should implement EmbeddedReferenceResolverInterface"); |
| 16 | 16 | } |
| 17 | 17 | parent::setReferenceResolver($referenceResolver); |
@@ -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 \Exception("Reference resolver injected into EzXmlText field handler should implement EmbeddedReferenceResolverInterface"); |
| 16 | 16 | } |
| 17 | 17 | parent::setReferenceResolver($referenceResolver); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function getReferenceValue($identifier) |
| 33 | 33 | { |
| 34 | - switch(substr($identifier, 5)) { |
|
| 34 | + switch (substr($identifier, 5)) { |
|
| 35 | 35 | case 'iteration': |
| 36 | 36 | return end($this->stack); |
| 37 | 37 | case 'depth': |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | echo 'B';*/ |
| 50 | 50 | |
| 51 | 51 | $ms->executeMigration(new MigrationDefinition( |
| 52 | - 'test_'.time(), |
|
| 52 | + 'test_' . time(), |
|
| 53 | 53 | '/hello', |
| 54 | 54 | '123', |
| 55 | 55 | MigrationDefinition::STATUS_PARSED, |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $sh = $this->getContainer()->get('ez_migration_bundle.storage_handler'); |
| 64 | 64 | |
| 65 | - $m1 = 'hello_'.time(); |
|
| 66 | - $m2 = 'there_'.time(); |
|
| 65 | + $m1 = 'hello_' . time(); |
|
| 66 | + $m2 = 'there_' . time(); |
|
| 67 | 67 | $sh->startMigration(new MigrationDefinition( |
| 68 | 68 | $m1, |
| 69 | 69 | '/hello', |