@@ -107,7 +107,9 @@ discard block |
||
| 107 | 107 | if (!empty($sort)) { |
| 108 | 108 | $query->sortClauses = $this->getSortClauses($sort); |
| 109 | 109 | } |
| 110 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 110 | + if (isset($query->performCount)) { |
|
| 111 | + $query->performCount = false; |
|
| 112 | + } |
|
| 111 | 113 | |
| 112 | 114 | $results = $this->getSearchService()->findLocations($query); |
| 113 | 115 | |
@@ -254,7 +256,9 @@ discard block |
||
| 254 | 256 | { |
| 255 | 257 | $query = new LocationQuery(); |
| 256 | 258 | $query->limit = self::INT_MAX_16BIT; |
| 257 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 259 | + if (isset($query->performCount)) { |
|
| 260 | + $query->performCount = false; |
|
| 261 | + } |
|
| 258 | 262 | $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds); |
| 259 | 263 | |
| 260 | 264 | $results = $this->getSearchService()->findLocations($query); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | protected $ioDecorator; |
| 11 | 11 | protected $ioService; |
| 12 | 12 | |
| 13 | - public function __construct($ioRootDir, UrlDecorator $ioDecorator=null, $ioService=null) |
|
| 13 | + public function __construct($ioRootDir, UrlDecorator $ioDecorator = null, $ioService = null) |
|
| 14 | 14 | { |
| 15 | 15 | $this->ioRootDir = $ioRootDir; |
| 16 | 16 | $this->ioDecorator = $ioDecorator; |
@@ -120,6 +120,6 @@ |
||
| 120 | 120 | { |
| 121 | 121 | $rootDir = realpath($this->kernel->getRootDir() . '/..') . '/'; |
| 122 | 122 | // note: we handle the case of 'path = root dir', but path is expected to include a filename... |
| 123 | - return $path === $rootDir ? './' : preg_replace('#^' . preg_quote($rootDir, '#'). '#', '', $path); |
|
| 123 | + return $path === $rootDir ? './' : preg_replace('#^' . preg_quote($rootDir, '#') . '#', '', $path); |
|
| 124 | 124 | } |
| 125 | 125 | } |
@@ -45,12 +45,12 @@ |
||
| 45 | 45 | return array( |
| 46 | 46 | new ExpressionFunction( |
| 47 | 47 | 'resolve', |
| 48 | - function ($str) { |
|
| 48 | + function($str) { |
|
| 49 | 49 | /// @todo we could implement this via eg a static class var which holds a pointer to $this->referenceResolver |
| 50 | 50 | //return sprintf('(is_string(%1$s) ? FakerResolver::resolveExpressionLanguageReference(%1$s) : %1$s)', $str); |
| 51 | 51 | return "throw new MigrationBundleException('The \'resolve\' expression language operator can not be compiled, only evaluated'"; |
| 52 | 52 | }, |
| 53 | - function ($arguments, $str) use ($resolver) { |
|
| 53 | + function($arguments, $str) use ($resolver) { |
|
| 54 | 54 | if (!is_string($str)) { |
| 55 | 55 | return $str; |
| 56 | 56 | } |
@@ -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; |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | - } |
|
| 65 | - else { |
|
| 64 | + } else { |
|
| 66 | 65 | throw new MigrationBundleException("Path '$path' is neither a file nor directory"); |
| 67 | 66 | } |
| 68 | 67 | } |
@@ -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); |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | $missed = $total - $this->migrationsDone[Migration::STATUS_DONE] - $this->migrationsDone[Migration::STATUS_FAILED] - $this->migrationsDone[Migration::STATUS_SKIPPED]; |
| 183 | - $this->writeln("\nExecuted ".$this->migrationsDone[Migration::STATUS_DONE].' migrations'. |
|
| 184 | - ', failed '.$this->migrationsDone[Migration::STATUS_FAILED]. |
|
| 185 | - ', skipped '.$this->migrationsDone[Migration::STATUS_SKIPPED]. |
|
| 183 | + $this->writeln("\nExecuted " . $this->migrationsDone[Migration::STATUS_DONE] . ' migrations' . |
|
| 184 | + ', failed ' . $this->migrationsDone[Migration::STATUS_FAILED] . |
|
| 185 | + ', skipped ' . $this->migrationsDone[Migration::STATUS_SKIPPED] . |
|
| 186 | 186 | ($missed ? ", missed $missed" : '')); |
| 187 | 187 | |
| 188 | 188 | $time = microtime(true) - $start; |
| 189 | 189 | // since we use subprocesses, we can not measure max memory used |
| 190 | - $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs</info>"); |
|
| 190 | + $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs</info>"); |
|
| 191 | 191 | |
| 192 | 192 | return $subprocessesFailed + $this->migrationsDone[Migration::STATUS_FAILED] + $missed; |
| 193 | 193 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | foreach ($toExecute as $name => $migrationDefinition) { |
| 242 | 242 | // let's skip migrations that we know are invalid - user was warned and he decided to proceed anyway |
| 243 | 243 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
| 244 | - $this->writeln("<comment>Skipping migration (invalid definition?) Path: ".$migrationDefinition->path."</comment>", self::$VERBOSITY_CHILD); |
|
| 244 | + $this->writeln("<comment>Skipping migration (invalid definition?) Path: " . $migrationDefinition->path . "</comment>", self::$VERBOSITY_CHILD); |
|
| 245 | 245 | $skipped++; |
| 246 | 246 | continue; |
| 247 | 247 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | * @param string $buffer |
| 315 | 315 | * @param null|\Symfony\Component\Process\Process $process |
| 316 | 316 | */ |
| 317 | - public function onChildProcessOutput($type, $buffer, $process=null) |
|
| 317 | + public function onChildProcessOutput($type, $buffer, $process = null) |
|
| 318 | 318 | { |
| 319 | 319 | $lines = explode("\n", trim($buffer)); |
| 320 | 320 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | // we tag the output with the id of the child process |
| 334 | 334 | if (trim($line) !== '') { |
| 335 | - $msg = '[' . ($process ? $process->getPid() : ''). '] ' . trim($line); |
|
| 335 | + $msg = '[' . ($process ? $process->getPid() : '') . '] ' . trim($line); |
|
| 336 | 336 | if ($type == 'err') { |
| 337 | 337 | $this->writeErrorln($msg, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW); |
| 338 | 338 | } else { |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | { |
| 409 | 409 | $output->writeln('Found ' . count($toExecute) . ' migrations in ' . count($paths) . ' directories'); |
| 410 | 410 | $output->writeln('In the same directories, migrations previously executed: ' . $this->migrationsAlreadyDone[Migration::STATUS_DONE] . |
| 411 | - ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]); |
|
| 411 | + ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: ' . $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]); |
|
| 412 | 412 | if ($this->migrationsAlreadyDone[Migration::STATUS_STARTED]) { |
| 413 | 413 | $output->writeln('<info>In the same directories, migrations currently executing: ' . $this->migrationsAlreadyDone[Migration::STATUS_STARTED] . '</info>'); |
| 414 | 414 | } |