From d9640a877bd1b842aa7d0085546eeabdabb9fcae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Thu, 23 Jan 2020 13:48:38 +0100 Subject: [PATCH 1/2] symfony/console 5.0 support Similar to https://github.com/doctrine/orm/pull/7876 --- composer.json | 2 +- lib/Console/Command/MigrationsCommand.php | 4 +++- lib/Console/Command/ReleaseLockCommand.php | 4 +++- lib/Console/Command/VersionsCommand.php | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index a42e478..4e518b3 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": "^7.0", "mongodb/mongodb": "^1.0.0", - "symfony/console": "^3.0|^4.0" + "symfony/console": "^3.0|^4.0|5.0" }, "require-dev": { "phpunit/phpunit": "^5.7.27 || ^6.0 || ^7.0 || ^8.0" diff --git a/lib/Console/Command/MigrationsCommand.php b/lib/Console/Command/MigrationsCommand.php index d3751f4..09cdf86 100644 --- a/lib/Console/Command/MigrationsCommand.php +++ b/lib/Console/Command/MigrationsCommand.php @@ -47,7 +47,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) + protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int { $directories = $input->getArgument('migration-directories'); $migrations = $this->getMigrations($directories); @@ -126,5 +126,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O } finally { $this->releaseLock($db); } + + return 0; } } diff --git a/lib/Console/Command/ReleaseLockCommand.php b/lib/Console/Command/ReleaseLockCommand.php index d329274..7df2581 100644 --- a/lib/Console/Command/ReleaseLockCommand.php +++ b/lib/Console/Command/ReleaseLockCommand.php @@ -34,7 +34,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) + protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int { $client = new Client($input->getOption('server')); $db = $client->selectDatabase($input->getArgument('database')); @@ -43,5 +43,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O $databaseMigrationsLockCollection = $db->selectCollection('DATABASE_MIGRATIONS_LOCK'); $databaseMigrationsLockCollection->updateOne(['locked' => ['$exists' => true]], ['$set' => ['locked' => false]], ['upsert' => true]); $output->writeln("✓ Successfully released migration lock"); + + return 0; } } diff --git a/lib/Console/Command/VersionsCommand.php b/lib/Console/Command/VersionsCommand.php index 8927376..f0b8022 100644 --- a/lib/Console/Command/VersionsCommand.php +++ b/lib/Console/Command/VersionsCommand.php @@ -82,7 +82,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) + protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int { $id = $input->getOption('id'); $directories = $input->getArgument('migration-directories'); @@ -133,6 +133,8 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O } finally { $this->releaseLock($db); } + + return 0; } /** From 170161fe27f1c995da24e009cb0250a768ebd11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Thu, 23 Jan 2020 13:50:53 +0100 Subject: [PATCH 2/2] Update travis php7.4 constraint --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db18d0f..a3a5794 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7.1 - 7.2 - 7.3 - - 7.4snapshot + - 7.4 services: - mongodb