Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Uid] add command to generate UIDs #36405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Prev Previous commit
Next Next commit
Remove command if UID component is not installed.
  • Loading branch information
Guillaume Pédelagrabe committed Apr 10, 2020
commit d9bb05ad383551f60e9c5965774fdccfaa484dd5
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

if (!class_exists(AbstractUid::class)) {
throw new \RuntimeException('Unable to execute this command as the Symfony Uid Component is not installed.');
}

$type = $input->getArgument('type') ? strtolower($input->getArgument('type')) : null;
$namespace = $input->getArgument('namespace');
$name = $input->getArgument('name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
use Symfony\Component\String\Slugger\SluggerInterface;
use Symfony\Component\Translation\Command\XliffLintCommand as BaseXliffLintCommand;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Uid\AbstractUid;
use Symfony\Component\Validator\ConstraintValidatorInterface;
use Symfony\Component\Validator\Mapping\Loader\PropertyInfoLoader;
use Symfony\Component\Validator\ObjectInitializerInterface;
Expand Down Expand Up @@ -345,6 +346,10 @@ public function load(array $configs, ContainerBuilder $container)
}
}

if (!class_exists(AbstractUid::class)) {
$container->removeDefinition('console.command.uid_generate');
guillbdx marked this conversation as resolved.
Show resolved Hide resolved
}

if ($this->httpClientConfigEnabled = $this->isConfigEnabled($container, $config['http_client'])) {
$this->registerHttpClientConfiguration($config['http_client'], $container, $loader, $config['profiler']);
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.