@@ -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 | |
@@ -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 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * @param array $dsl |
| 70 | 70 | * @param array $context |
| 71 | - * @return string |
|
| 71 | + * @return boolean |
|
| 72 | 72 | * @throws \Exception |
| 73 | 73 | */ |
| 74 | 74 | protected function exists($dsl, $context) |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | /** |
| 197 | 197 | * @param array $dsl |
| 198 | 198 | * @param array $context |
| 199 | - * @return true |
|
| 199 | + * @return boolean |
|
| 200 | 200 | * @throws \Exception |
| 201 | 201 | */ |
| 202 | 202 | protected function copy($dsl, $context) |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | /** |
| 229 | 229 | * @param array $dsl |
| 230 | 230 | * @param array $context |
| 231 | - * @return true |
|
| 231 | + * @return boolean |
|
| 232 | 232 | * @throws \Exception |
| 233 | 233 | */ |
| 234 | 234 | protected function move($dsl, $context) |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | /** |
| 261 | 261 | * @param array $dsl |
| 262 | 262 | * @param array $context |
| 263 | - * @return true |
|
| 263 | + * @return boolean |
|
| 264 | 264 | * @throws \Exception |
| 265 | 265 | */ |
| 266 | 266 | protected function delete($dsl, $context) |
@@ -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); |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Kaliop\eZMigrationBundle\Core\MigrationService; |
| 7 | 7 | use Symfony\Component\Console\Input\InputInterface; |
| 8 | 8 | use Symfony\Component\Console\Output\OutputInterface; |
| 9 | -use Symfony\Component\Console\Input\InputOption; |
|
| 10 | 9 | use Kaliop\eZMigrationBundle\API\Value\Migration; |
| 11 | 10 | use Kaliop\eZMigrationBundle\API\Value\MigrationDefinition; |
| 12 | 11 | |
@@ -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', |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Kaliop\eZMigrationBundle\Core\Executor; |
| 4 | 4 | |
| 5 | 5 | use eZ\Publish\API\Repository\Values\Content\Language; |
| 6 | -use Kaliop\eZMigrationBundle\API\Collection\LanguageCollection; |
|
| 7 | 6 | |
| 8 | 7 | /** |
| 9 | 8 | * Handles language migrations. |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - foreach($referencesDefs as $reference) { |
|
| 228 | + foreach ($referencesDefs as $reference) { |
|
| 229 | 229 | $overwrite = false; |
| 230 | 230 | if (isset($reference['overwrite'])) { |
| 231 | 231 | $overwrite = $reference['overwrite']; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | // allow setting *some* refs even when we have 0 or N matches |
| 248 | 248 | foreach ($referencesDefinition as $key => $reference) { |
| 249 | - switch($reference['attribute']) { |
|
| 249 | + switch ($reference['attribute']) { |
|
| 250 | 250 | |
| 251 | 251 | case 'count': |
| 252 | 252 | $value = count($entity); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
| 316 | - * @param array $step |
|
| 316 | + * @param MigrationStep $step |
|
| 317 | 317 | * @return string |
| 318 | 318 | */ |
| 319 | 319 | protected function getReferencesType($step) |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
| 325 | - * @param array $step |
|
| 325 | + * @param MigrationStep $step |
|
| 326 | 326 | * @return bool |
| 327 | 327 | */ |
| 328 | 328 | protected function allowEmptyReferences($step) |
@@ -343,6 +343,9 @@ discard block |
||
| 343 | 343 | return preg_replace('/(?<!^)[A-Z]/', ' $0', $className); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | + /** |
|
| 347 | + * @param AbstractCollection $collection |
|
| 348 | + */ |
|
| 346 | 349 | protected function getCollectionName($collection) |
| 347 | 350 | { |
| 348 | 351 | $className = get_class($collection); |
@@ -329,8 +329,9 @@ |
||
| 329 | 329 | { |
| 330 | 330 | if (isset($step->dsl['references_type']) && $step->dsl['references_type'] == self::REFERENCE_TYPE_ARRAY && |
| 331 | 331 | isset($step->dsl['references_allow_empty']) && $step->dsl['references_allow_empty'] == true |
| 332 | - ) |
|
| 333 | - return true; |
|
| 332 | + ) { |
|
| 333 | + return true; |
|
| 334 | + } |
|
| 334 | 335 | return false; |
| 335 | 336 | } |
| 336 | 337 | |