Skip to content

Commit 95124ac

Browse files
authored
* Fix compatibility with doctrine 4 (#73)
* Remove some deprecated
1 parent 4011f39 commit 95124ac

8 files changed

Lines changed: 13 additions & 12 deletions

src/CodeRhapsodieDataflowBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getContainerExtension(): ?ExtensionInterface
2424
return new CodeRhapsodieDataflowExtension();
2525
}
2626

27-
public function build(ContainerBuilder $container)
27+
public function build(ContainerBuilder $container): void
2828
{
2929
$container
3030
->addCompilerPass(new DataflowTypeCompilerPass())

src/Command/AddScheduledDataflowCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(private DataflowTypeRegistryInterface $registry, pri
3030
/**
3131
* {@inheritdoc}
3232
*/
33-
protected function configure()
33+
protected function configure(): void
3434
{
3535
$this
3636
->setHelp('The <info>%command.name%</info> allows you to create a new scheduled dataflow.')

src/Command/ChangeScheduleStatusCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(private ScheduledDataflowRepository $scheduledDatafl
2929
/**
3030
* {@inheritdoc}
3131
*/
32-
protected function configure()
32+
protected function configure(): void
3333
{
3434
$this
3535
->setHelp('The <info>%command.name%</info> command able you to change schedule status.')

src/Command/ExecuteDataflowCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(private DataflowTypeRegistryInterface $registry, pri
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
protected function configure()
37+
protected function configure(): void
3838
{
3939
$this
4040
->setHelp(<<<'EOF'

src/Command/JobShowCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(private JobRepository $jobRepository, private Connec
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
protected function configure()
37+
protected function configure(): void
3838
{
3939
$this
4040
->setHelp('The <info>%command.name%</info> display job details for schedule or specific job.')

src/Command/RunPendingDataflowsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(private ScheduledDataflowManagerInterface $manager,
3232
/**
3333
* {@inheritdoc}
3434
*/
35-
protected function configure()
35+
protected function configure(): void
3636
{
3737
$this
3838
->setHelp(<<<'EOF'

src/Command/ScheduleListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(private ScheduledDataflowRepository $scheduledDatafl
2727
/**
2828
* {@inheritdoc}
2929
*/
30-
protected function configure()
30+
protected function configure(): void
3131
{
3232
$this
3333
->setHelp('The <info>%command.name%</info> lists all scheduled dataflows.')

src/Command/SchemaCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use CodeRhapsodie\DataflowBundle\Repository\JobRepository;
99
use CodeRhapsodie\DataflowBundle\Repository\ScheduledDataflowRepository;
1010
use CodeRhapsodie\DataflowBundle\SchemaProvider\DataflowSchemaProvider;
11+
use Doctrine\DBAL\Schema\Comparator;
1112
use Doctrine\DBAL\Schema\Schema;
1213
use Doctrine\DBAL\Schema\Table;
1314
use Symfony\Component\Console\Attribute\AsCommand;
@@ -31,7 +32,7 @@ public function __construct(private ConnectionFactory $connectionFactory)
3132
/**
3233
* {@inheritdoc}
3334
*/
34-
protected function configure()
35+
protected function configure(): void
3536
{
3637
$this
3738
->setHelp('The <info>%command.name%</info> help you to generate SQL Query to create or update your database schema for this bundle')
@@ -57,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5758
$sqls = $schema->toSql($connection->getDatabasePlatform());
5859

5960
if ($input->getOption('update')) {
60-
$sm = $connection->getSchemaManager();
61+
$sm = $connection->createSchemaManager();
6162

6263
$tableArray = [JobRepository::TABLE_NAME, ScheduledDataflowRepository::TABLE_NAME];
6364
$tables = [];
@@ -71,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7172
$namespaces = [];
7273

7374
if ($connection->getDatabasePlatform()->supportsSchemas()) {
74-
$namespaces = $sm->listNamespaceNames();
75+
$namespaces = $sm->listSchemaNames();
7576
}
7677

7778
$sequences = [];
@@ -82,14 +83,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8283

8384
$oldSchema = new Schema($tables, $sequences, $sm->createSchemaConfig(), $namespaces);
8485

85-
$sqls = $schema->getMigrateFromSql($oldSchema, $connection->getDatabasePlatform());
86+
$sqls = $connection->getDatabasePlatform()->getAlterSchemaSQL((new Comparator($connection->getDatabasePlatform()))->compareSchemas($oldSchema, $schema));
8687
}
8788
$io = new SymfonyStyle($input, $output);
8889
$io->text('Execute these SQL Queries on your database:');
8990
foreach ($sqls as $sql) {
9091
$io->text($sql.';');
9192
}
9293

93-
return 0;
94+
return parent::SUCCESS;
9495
}
9596
}

0 commit comments

Comments
 (0)