Skip to content

Commit

Permalink
Return int from execute() methods in Commands to fix a Symfony 4.…
Browse files Browse the repository at this point in the history
…4 deprecation notice (#3)
  • Loading branch information
mpdude authored Apr 11, 2022
1 parent c6699cc commit ccf1145
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Command/ListSynchronizersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ protected function configure()
/**
* {@inheritDoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
foreach ($this->synchronizerRegistry->getObjectclasses() as $objectclass) {
$output->writeln($objectclass);
}

return 0;
}
}
4 changes: 3 additions & 1 deletion src/Command/SynchronizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function configure()
/**
* {@inheritDoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$force = $input->getOption('force');
$only = $input->getOption('only');
Expand All @@ -75,5 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->synchronizerRegistry->getSynchronizer($objectclass)
->synchronize($objectclass, $force);
}

return 0;
}
}

0 comments on commit ccf1145

Please sign in to comment.