Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Symfony 7 by adding return types conditionally #10919

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ORM\Cache;
use Doctrine\ORM\Tools\Console\Command\AbstractEntityManagerCommand;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -20,6 +21,8 @@
*/
class CollectionRegionCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -58,12 +61,7 @@ protected function configure()
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ORM\Cache;
use Doctrine\ORM\Tools\Console\Command\AbstractEntityManagerCommand;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -20,6 +21,8 @@
*/
class EntityRegionCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -57,12 +60,7 @@ protected function configure()
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\ORM\Tools\Console\Command\ClearCache;

use Doctrine\ORM\Tools\Console\Command\AbstractEntityManagerCommand;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -18,6 +19,8 @@
*/
class MetadataCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand All @@ -31,12 +34,7 @@
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int

Check warning on line 37 in lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php#L37

Added line #L37 was not covered by tests
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Doctrine\Common\Cache\FlushableCache;
use Doctrine\Common\Cache\XcacheCache;
use Doctrine\ORM\Tools\Console\Command\AbstractEntityManagerCommand;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use InvalidArgumentException;
use LogicException;
use Symfony\Component\Cache\Adapter\ApcuAdapter;
Expand All @@ -28,6 +29,8 @@
*/
class QueryCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -55,13 +58,8 @@
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{

Check warning on line 62 in lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php#L61-L62

Added lines #L61 - L62 were not covered by tests
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

$em = $this->getEntityManager($input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ORM\Cache;
use Doctrine\ORM\Tools\Console\Command\AbstractEntityManagerCommand;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -20,6 +21,8 @@
*/
class QueryRegionCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -56,12 +59,7 @@ protected function configure()
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\Common\Cache\XcacheCache;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\Tools\Console\Command\AbstractEntityManagerCommand;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use InvalidArgumentException;
use LogicException;
use Symfony\Component\Cache\Adapter\ApcuAdapter;
Expand All @@ -29,6 +30,8 @@
*/
class ResultCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -56,12 +59,7 @@ protected function configure()
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Tools\Console\Command;

use Doctrine\ORM\Tools\Console\CommandCompatibility;
use Doctrine\ORM\Tools\ConvertDoctrine1Schema;
use Doctrine\ORM\Tools\EntityGenerator;
use Doctrine\ORM\Tools\Export\ClassMetadataExporter;
Expand Down Expand Up @@ -34,6 +35,8 @@
*/
class ConvertDoctrine1SchemaCommand extends Command
{
use CommandCompatibility;

/** @var EntityGenerator|null */
private $entityGenerator = null;

Expand Down Expand Up @@ -87,12 +90,7 @@
->setHelp('Converts Doctrine 1.x schema into a Doctrine 2.x schema.');
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int

Check warning on line 93 in lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php#L93

Added line #L93 was not covered by tests
{
$ui = new SymfonyStyle($input, $output);
$ui->getErrorStyle()->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
Expand Down
10 changes: 4 additions & 6 deletions lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\DBAL\Connection;
use Doctrine\ORM\Mapping\Driver\DatabaseDriver;
use Doctrine\ORM\Tools\Console\CommandCompatibility;
use Doctrine\ORM\Tools\Console\MetadataFilter;
use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
use Doctrine\ORM\Tools\EntityGenerator;
Expand Down Expand Up @@ -37,6 +38,8 @@
*/
class ConvertMappingCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -84,12 +87,7 @@
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int

Check warning on line 90 in lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php#L90

Added line #L90 was not covered by tests
{
$ui = new SymfonyStyle($input, $output);
$ui->getErrorStyle()->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Tools\Console\Command;

use Doctrine\ORM\Tools\Console\CommandCompatibility;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -19,6 +20,8 @@
*/
class EnsureProductionSettingsCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand All @@ -29,12 +32,7 @@ protected function configure()
->setHelp('Verify that Doctrine is properly configured for a production environment.');
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();
$ui->warning('This console command has been deprecated and will be removed in a future version of Doctrine ORM.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Tools\Console\Command;

use Doctrine\ORM\Tools\Console\CommandCompatibility;
use Doctrine\ORM\Tools\Console\MetadataFilter;
use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
use Doctrine\ORM\Tools\EntityGenerator;
Expand All @@ -28,6 +29,8 @@
*/
class GenerateEntitiesCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand Down Expand Up @@ -67,12 +70,7 @@
);
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int

Check warning on line 73 in lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php#L73

Added line #L73 was not covered by tests
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Tools\Console\Command;

use Doctrine\ORM\Tools\Console\CommandCompatibility;
use Doctrine\ORM\Tools\Console\MetadataFilter;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
Expand All @@ -26,6 +27,8 @@
*/
class GenerateProxiesCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand All @@ -38,12 +41,7 @@
->setHelp('Generates proxy classes for entity classes.');
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int

Check warning on line 44 in lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php#L44

Added line #L44 was not covered by tests
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Tools\Console\Command;

use Doctrine\ORM\Tools\Console\CommandCompatibility;
use Doctrine\ORM\Tools\Console\MetadataFilter;
use Doctrine\ORM\Tools\EntityRepositoryGenerator;
use InvalidArgumentException;
Expand All @@ -27,6 +28,8 @@
*/
class GenerateRepositoriesCommand extends AbstractEntityManagerCommand
{
use CommandCompatibility;

/** @return void */
protected function configure()
{
Expand All @@ -39,12 +42,7 @@ protected function configure()
->setHelp('Generate repository classes from your mapping information.');
}

/**
* {@inheritDoc}
*
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
private function doExecute(InputInterface $input, OutputInterface $output): int
{
$ui = (new SymfonyStyle($input, $output))->getErrorStyle();
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
Expand Down
Loading