Skip to content

Commit

Permalink
Merge pull request #7876 from nicolas-grekas/sf5-cmd
Browse files Browse the repository at this point in the history
Fix compat of commands with Symfony 5
  • Loading branch information
lcobucci authored Oct 23, 2019
2 parents d9c30e3 + 4d6b1f3 commit 2d643e6
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
)
);

return;
return 0;
}

if ($input->getOption('all')) {
$ui->comment('Clearing <info>all</info> second-level cache collection regions');

$cache->evictEntityRegions();

return;
return 0;
}

if ($ownerId) {
Expand All @@ -138,10 +138,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
$cache->evictCollection($ownerClass, $assoc, $ownerId);

return;
return 0;
}

$ui->comment(sprintf('Clearing second-level cache for collection <info>"%s#%s"</info>', $ownerClass, $assoc));
$cache->evictCollectionRegion($ownerClass, $assoc);

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ protected function execute(InputInterface $input, OutputInterface $output)

$ui->comment(sprintf('Flushing cache provider configured for entity named <info>"%s"</info>', $entityClass));

return;
return 0;
}

if ($input->getOption('all')) {
$ui->comment('Clearing <info>all</info> second-level cache entity regions');

$cache->evictEntityRegions();

return;
return 0;
}

if ($entityId) {
Expand All @@ -129,10 +129,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
$cache->evictEntity($entityClass, $entityId);

return;
return 0;
}

$ui->comment(sprintf('Clearing second-level cache for entity <info>"%s"</info>', $entityClass));
$cache->evictEntityRegion($entityClass);

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
)
);

return;
return 0;
}

if ($input->getOption('all')) {
$ui->comment('Clearing <info>all</info> second-level cache query regions');

$cache->evictQueryRegions();

return;
return 0;
}

$ui->comment(sprintf('Clearing second-level cache query region named <info>"%s"</info>', $name));
$cache->evictQueryRegion($name);

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$numSpaces = $input->getOption('num-spaces');

$this->convertDoctrine1Schema($fromPaths, $destPath, $toType, $numSpaces, $extend, $output);

return 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$destPath
)
);

return 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

if (empty($metadatas)) {
$ui->success('No Metadata Classes to process.');
return;
return 0;
}

$entityGenerator = new EntityGenerator();
Expand All @@ -138,5 +138,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Outputting information message
$ui->newLine();
$ui->success(sprintf('Entity classes generated to "%s"', $destPath));

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

if (empty($metadatas)) {
$ui->success('No Metadata Classes to process.');
return;
return 0;
}

foreach ($metadatas as $metadata) {
Expand All @@ -104,5 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Outputting information message
$ui->newLine();
$ui->text(sprintf('Proxy classes generated to "<info>%s</info>"', $destPath));

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

if (empty($metadatas)) {
$ui->success('No Metadata Classes to process.');
return;
return 0;
}

$numRepositories = 0;
Expand All @@ -104,11 +104,13 @@ protected function execute(InputInterface $input, OutputInterface $output)

if ($numRepositories === 0) {
$ui->text('No Repository classes were found to be processed.');
return;
return 0;
}

// Outputting information message
$ui->newLine();
$ui->text(sprintf('Repository classes generated to "<info>%s</info>"', $destPath));

return 0;
}
}
4 changes: 3 additions & 1 deletion lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ protected function execute(InputInterface $input, OutputInterface $output)

if ($input->getOption('show-sql')) {
$ui->text($query->getSQL());
return;
return 0;
}

$resultSet = $query->execute([], constant($hydrationMode));

$ui->text(Debug::dump($resultSet, $input->getOption('depth'), true, false));

return 0;
}
}

0 comments on commit 2d643e6

Please sign in to comment.