diff --git a/src/CodeRhapsodieDataflowBundle.php b/src/CodeRhapsodieDataflowBundle.php
index 21a28f3..fd84009 100644
--- a/src/CodeRhapsodieDataflowBundle.php
+++ b/src/CodeRhapsodieDataflowBundle.php
@@ -24,7 +24,7 @@ class CodeRhapsodieDataflowBundle extends Bundle
return new CodeRhapsodieDataflowExtension();
}
- public function build(ContainerBuilder $container)
+ public function build(ContainerBuilder $container): void
{
$container
->addCompilerPass(new DataflowTypeCompilerPass())
diff --git a/src/Command/AddScheduledDataflowCommand.php b/src/Command/AddScheduledDataflowCommand.php
index a13a30b..807fbcb 100644
--- a/src/Command/AddScheduledDataflowCommand.php
+++ b/src/Command/AddScheduledDataflowCommand.php
@@ -30,7 +30,7 @@ class AddScheduledDataflowCommand extends Command
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp('The %command.name% allows you to create a new scheduled dataflow.')
diff --git a/src/Command/ChangeScheduleStatusCommand.php b/src/Command/ChangeScheduleStatusCommand.php
index 3bac2c4..cca2565 100644
--- a/src/Command/ChangeScheduleStatusCommand.php
+++ b/src/Command/ChangeScheduleStatusCommand.php
@@ -29,7 +29,7 @@ class ChangeScheduleStatusCommand extends Command
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp('The %command.name% command able you to change schedule status.')
diff --git a/src/Command/ExecuteDataflowCommand.php b/src/Command/ExecuteDataflowCommand.php
index d1379b5..0f7fa8e 100644
--- a/src/Command/ExecuteDataflowCommand.php
+++ b/src/Command/ExecuteDataflowCommand.php
@@ -34,7 +34,7 @@ class ExecuteDataflowCommand extends Command implements LoggerAwareInterface
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp(<<<'EOF'
diff --git a/src/Command/JobShowCommand.php b/src/Command/JobShowCommand.php
index 40063c1..0bde6ec 100644
--- a/src/Command/JobShowCommand.php
+++ b/src/Command/JobShowCommand.php
@@ -34,7 +34,7 @@ class JobShowCommand extends Command
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp('The %command.name% display job details for schedule or specific job.')
diff --git a/src/Command/RunPendingDataflowsCommand.php b/src/Command/RunPendingDataflowsCommand.php
index 2e4cefa..cc2045a 100644
--- a/src/Command/RunPendingDataflowsCommand.php
+++ b/src/Command/RunPendingDataflowsCommand.php
@@ -32,7 +32,7 @@ class RunPendingDataflowsCommand extends Command
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp(<<<'EOF'
diff --git a/src/Command/ScheduleListCommand.php b/src/Command/ScheduleListCommand.php
index 3d31c5d..ee08524 100644
--- a/src/Command/ScheduleListCommand.php
+++ b/src/Command/ScheduleListCommand.php
@@ -27,7 +27,7 @@ class ScheduleListCommand extends Command
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp('The %command.name% lists all scheduled dataflows.')
diff --git a/src/Command/SchemaCommand.php b/src/Command/SchemaCommand.php
index f942703..74c893e 100644
--- a/src/Command/SchemaCommand.php
+++ b/src/Command/SchemaCommand.php
@@ -8,6 +8,7 @@ use CodeRhapsodie\DataflowBundle\Factory\ConnectionFactory;
use CodeRhapsodie\DataflowBundle\Repository\JobRepository;
use CodeRhapsodie\DataflowBundle\Repository\ScheduledDataflowRepository;
use CodeRhapsodie\DataflowBundle\SchemaProvider\DataflowSchemaProvider;
+use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;
use Symfony\Component\Console\Attribute\AsCommand;
@@ -31,7 +32,7 @@ class SchemaCommand extends Command
/**
* {@inheritdoc}
*/
- protected function configure()
+ protected function configure(): void
{
$this
->setHelp('The %command.name% help you to generate SQL Query to create or update your database schema for this bundle')
@@ -57,7 +58,7 @@ class SchemaCommand extends Command
$sqls = $schema->toSql($connection->getDatabasePlatform());
if ($input->getOption('update')) {
- $sm = $connection->getSchemaManager();
+ $sm = $connection->createSchemaManager();
$tableArray = [JobRepository::TABLE_NAME, ScheduledDataflowRepository::TABLE_NAME];
$tables = [];
@@ -71,7 +72,7 @@ class SchemaCommand extends Command
$namespaces = [];
if ($connection->getDatabasePlatform()->supportsSchemas()) {
- $namespaces = $sm->listNamespaceNames();
+ $namespaces = $sm->listSchemaNames();
}
$sequences = [];
@@ -82,7 +83,7 @@ class SchemaCommand extends Command
$oldSchema = new Schema($tables, $sequences, $sm->createSchemaConfig(), $namespaces);
- $sqls = $schema->getMigrateFromSql($oldSchema, $connection->getDatabasePlatform());
+ $sqls = $connection->getDatabasePlatform()->getAlterSchemaSQL((new Comparator($connection->getDatabasePlatform()))->compareSchemas($oldSchema, $schema));
}
$io = new SymfonyStyle($input, $output);
$io->text('Execute these SQL Queries on your database:');
@@ -90,6 +91,6 @@ class SchemaCommand extends Command
$io->text($sql.';');
}
- return 0;
+ return parent::SUCCESS;
}
}