Skip to content

Commit

Permalink
Merge pull request #22 from ostrolucky/symfony-5
Browse files Browse the repository at this point in the history
 symfony/console 5.0 support
  • Loading branch information
gruberro authored Jan 23, 2020
2 parents 1832755 + 170161f commit e7e3642
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
- 7.4

services:
- mongodb
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion lib/Console/Command/MigrationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -126,5 +126,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
} finally {
$this->releaseLock($db);
}

return 0;
}
}
4 changes: 3 additions & 1 deletion lib/Console/Command/ReleaseLockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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("<info>✓ Successfully released migration lock</info>");

return 0;
}
}
4 changes: 3 additions & 1 deletion lib/Console/Command/VersionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -133,6 +133,8 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
} finally {
$this->releaseLock($db);
}

return 0;
}

/**
Expand Down

0 comments on commit e7e3642

Please sign in to comment.