mirror of
https://github.com/symfony/maker-bundle.git
synced 2026-03-23 23:42:10 +01:00
bug #1445 [make:entity] use ux-turbo instead of ux-turbo-mercure
This commit is contained in:
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
mercure:
|
||||
image: dunglas/mercure
|
||||
environment:
|
||||
SERVER_NAME: :1337
|
||||
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||
MERCURE_EXTRA_DIRECTIVES: |
|
||||
anonymous
|
||||
cors_origins *
|
||||
ports:
|
||||
- 1337:1337
|
||||
@@ -20,6 +20,7 @@ use Symfony\Bundle\MakerBundle\Doctrine\EntityClassGenerator;
|
||||
use Symfony\Bundle\MakerBundle\Doctrine\EntityRegenerator;
|
||||
use Symfony\Bundle\MakerBundle\Doctrine\EntityRelation;
|
||||
use Symfony\Bundle\MakerBundle\Doctrine\ORMDependencyBuilder;
|
||||
use Symfony\Bundle\MakerBundle\Exception\RuntimeCommandException;
|
||||
use Symfony\Bundle\MakerBundle\FileManager;
|
||||
use Symfony\Bundle\MakerBundle\Generator;
|
||||
use Symfony\Bundle\MakerBundle\InputAwareMakerInterface;
|
||||
@@ -31,6 +32,7 @@ use Symfony\Bundle\MakerBundle\Util\ClassSourceManipulator;
|
||||
use Symfony\Bundle\MakerBundle\Util\CliOutputHelper;
|
||||
use Symfony\Bundle\MakerBundle\Util\PhpCompatUtil;
|
||||
use Symfony\Bundle\MakerBundle\Validator;
|
||||
use Symfony\Bundle\MercureBundle\DependencyInjection\MercureExtension;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@@ -149,6 +151,11 @@ final class MakeEntity extends AbstractMaker implements InputAwareMakerInterface
|
||||
&& class_exists(Broadcast::class)
|
||||
&& !class_exists($this->generator->createClassNameDetails($entityClassName, 'Entity\\')->getFullName())
|
||||
) {
|
||||
// Mercure is needed
|
||||
if (!class_exists(MercureExtension::class)) {
|
||||
throw new RuntimeCommandException('Please run "composer require symfony/mercure". It is needed to broadcast entities.');
|
||||
}
|
||||
|
||||
$description = $command->getDefinition()->getOption('broadcast')->getDescription();
|
||||
$question = new ConfirmationQuestion($description, false);
|
||||
$isBroadcast = $io->askQuestion($question);
|
||||
@@ -321,7 +328,7 @@ final class MakeEntity extends AbstractMaker implements InputAwareMakerInterface
|
||||
if (null !== $input && $input->getOption('broadcast')) {
|
||||
$dependencies->addClassDependency(
|
||||
Broadcast::class,
|
||||
'ux-turbo-mercure'
|
||||
'ux-turbo'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,18 +44,12 @@ class MakeEntityTest extends MakerTestCase
|
||||
;
|
||||
}
|
||||
|
||||
// @legacy - MakeEntity uses ux-turbo-mercure (archived), it needs to use ux-turbo (mercure built in) for Symfony 7.0
|
||||
if ('7.0.x-dev' === $_SERVER['SYMFONY_VERSION']) {
|
||||
return $this->createMakerTest()
|
||||
->skipTest('symfony/ux-turbo-mercure is not supported on Symfony 7.')
|
||||
;
|
||||
}
|
||||
|
||||
return $this->createMakeEntityTest()
|
||||
->preRun(function (MakerTestRunner $runner) {
|
||||
// installed manually later so that the compatibility check can run first
|
||||
$runner->runProcess('composer require symfony/ux-turbo-mercure');
|
||||
$runner->runProcess('composer require symfony/ux-turbo');
|
||||
})
|
||||
->addExtraDependencies('mercure', 'twig')
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user