|
20 | 20 | use Symfony\Bundle\MakerBundle\Doctrine\EntityRegenerator;
|
21 | 21 | use Symfony\Bundle\MakerBundle\Doctrine\EntityRelation;
|
22 | 22 | use Symfony\Bundle\MakerBundle\Doctrine\ORMDependencyBuilder;
|
| 23 | +use Symfony\Bundle\MakerBundle\Exception\RuntimeCommandException; |
23 | 24 | use Symfony\Bundle\MakerBundle\FileManager;
|
24 | 25 | use Symfony\Bundle\MakerBundle\Generator;
|
25 | 26 | use Symfony\Bundle\MakerBundle\InputAwareMakerInterface;
|
|
31 | 32 | use Symfony\Bundle\MakerBundle\Util\CliOutputHelper;
|
32 | 33 | use Symfony\Bundle\MakerBundle\Util\PhpCompatUtil;
|
33 | 34 | use Symfony\Bundle\MakerBundle\Validator;
|
| 35 | +use Symfony\Bundle\MercureBundle\DependencyInjection\MercureExtension; |
34 | 36 | use Symfony\Component\Console\Command\Command;
|
35 | 37 | use Symfony\Component\Console\Input\InputArgument;
|
36 | 38 | use Symfony\Component\Console\Input\InputInterface;
|
@@ -149,6 +151,11 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
|
149 | 151 | && class_exists(Broadcast::class)
|
150 | 152 | && !class_exists($this->generator->createClassNameDetails($entityClassName, 'Entity\\')->getFullName())
|
151 | 153 | ) {
|
| 154 | + // Mercure is needed |
| 155 | + if (!class_exists(MercureExtension::class)) { |
| 156 | + throw new RuntimeCommandException('Please run "composer require symfony/mercure". It is needed to broadcast entities.'); |
| 157 | + } |
| 158 | + |
152 | 159 | $description = $command->getDefinition()->getOption('broadcast')->getDescription();
|
153 | 160 | $question = new ConfirmationQuestion($description, false);
|
154 | 161 | $isBroadcast = $io->askQuestion($question);
|
@@ -321,7 +328,7 @@ public function configureDependencies(DependencyBuilder $dependencies, ?InputInt
|
321 | 328 | if (null !== $input && $input->getOption('broadcast')) {
|
322 | 329 | $dependencies->addClassDependency(
|
323 | 330 | Broadcast::class,
|
324 |
| - 'ux-turbo-mercure' |
| 331 | + 'ux-turbo' |
325 | 332 | );
|
326 | 333 | }
|
327 | 334 |
|
|
0 commit comments