Skip to content

Commit 9f85e27

Browse files
authored
Add native types to command classes (#9359)
1 parent cf62f93 commit 9f85e27

23 files changed

+53
-245
lines changed

lib/Doctrine/ORM/Tools/Console/Command/AbstractEntityManagerCommand.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212

1313
abstract class AbstractEntityManagerCommand extends Command
1414
{
15-
/** @var EntityManagerProvider|null */
16-
private $entityManagerProvider;
17-
18-
public function __construct(?EntityManagerProvider $entityManagerProvider = null)
15+
public function __construct(private ?EntityManagerProvider $entityManagerProvider = null)
1916
{
2017
parent::__construct();
21-
22-
$this->entityManagerProvider = $entityManagerProvider;
2318
}
2419

2520
final protected function getEntityManager(InputInterface $input): EntityManagerInterface

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
*/
2121
class CollectionRegionCommand extends AbstractEntityManagerCommand
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
26-
protected function configure()
23+
protected function configure(): void
2724
{
2825
$this->setName('orm:clear-cache:region:collection')
2926
->setDescription('Clear a second-level cache collection region')
@@ -60,12 +57,7 @@ protected function configure()
6057
);
6158
}
6259

63-
/**
64-
* {@inheritdoc}
65-
*
66-
* @return int
67-
*/
68-
protected function execute(InputInterface $input, OutputInterface $output)
60+
protected function execute(InputInterface $input, OutputInterface $output): int
6961
{
7062
$ui = new SymfonyStyle($input, $output);
7163

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
*/
2121
class EntityRegionCommand extends AbstractEntityManagerCommand
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
26-
protected function configure()
23+
protected function configure(): void
2724
{
2825
$this->setName('orm:clear-cache:region:entity')
2926
->setDescription('Clear a second-level cache entity region')
@@ -59,12 +56,7 @@ protected function configure()
5956
);
6057
}
6158

62-
/**
63-
* {@inheritdoc}
64-
*
65-
* @return int
66-
*/
67-
protected function execute(InputInterface $input, OutputInterface $output)
59+
protected function execute(InputInterface $input, OutputInterface $output): int
6860
{
6961
$ui = new SymfonyStyle($input, $output);
7062

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
*/
1919
class MetadataCommand extends AbstractEntityManagerCommand
2020
{
21-
/**
22-
* {@inheritdoc}
23-
*/
24-
protected function configure()
21+
protected function configure(): void
2522
{
2623
$this->setName('orm:clear-cache:metadata')
2724
->setDescription('Clear all metadata cache of the various cache drivers')
@@ -33,12 +30,7 @@ protected function configure()
3330
);
3431
}
3532

36-
/**
37-
* {@inheritdoc}
38-
*
39-
* @return int
40-
*/
41-
protected function execute(InputInterface $input, OutputInterface $output)
33+
protected function execute(InputInterface $input, OutputInterface $output): int
4234
{
4335
$ui = new SymfonyStyle($input, $output);
4436

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
*/
2828
class QueryCommand extends AbstractEntityManagerCommand
2929
{
30-
/**
31-
* {@inheritdoc}
32-
*/
33-
protected function configure()
30+
protected function configure(): void
3431
{
3532
$this->setName('orm:clear-cache:query')
3633
->setDescription('Clear all query cache of the various cache drivers')
@@ -56,12 +53,7 @@ protected function configure()
5653
);
5754
}
5855

59-
/**
60-
* {@inheritdoc}
61-
*
62-
* @return int
63-
*/
64-
protected function execute(InputInterface $input, OutputInterface $output)
56+
protected function execute(InputInterface $input, OutputInterface $output): int
6557
{
6658
$ui = new SymfonyStyle($input, $output);
6759

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
*/
2121
class QueryRegionCommand extends AbstractEntityManagerCommand
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
26-
protected function configure()
23+
protected function configure(): void
2724
{
2825
$this->setName('orm:clear-cache:region:query')
2926
->setDescription('Clear a second-level cache query region')
@@ -58,12 +55,7 @@ protected function configure()
5855
);
5956
}
6057

61-
/**
62-
* {@inheritdoc}
63-
*
64-
* @return int
65-
*/
66-
protected function execute(InputInterface $input, OutputInterface $output)
58+
protected function execute(InputInterface $input, OutputInterface $output): int
6759
{
6860
$ui = new SymfonyStyle($input, $output);
6961

lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
*/
3030
class ResultCommand extends AbstractEntityManagerCommand
3131
{
32-
/**
33-
* {@inheritdoc}
34-
*/
35-
protected function configure()
32+
protected function configure(): void
3633
{
3734
$this->setName('orm:clear-cache:result')
3835
->setDescription('Clear all result cache of the various cache drivers')
@@ -58,12 +55,7 @@ protected function configure()
5855
);
5956
}
6057

61-
/**
62-
* {@inheritdoc}
63-
*
64-
* @return int
65-
*/
66-
protected function execute(InputInterface $input, OutputInterface $output)
58+
protected function execute(InputInterface $input, OutputInterface $output): int
6759
{
6860
$ui = new SymfonyStyle($input, $output);
6961

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
*/
2727
class GenerateProxiesCommand extends AbstractEntityManagerCommand
2828
{
29-
/**
30-
* {@inheritdoc}
31-
*/
32-
protected function configure()
29+
protected function configure(): void
3330
{
3431
$this->setName('orm:generate-proxies')
3532
->setAliases(['orm:generate:proxies'])
@@ -40,12 +37,7 @@ protected function configure()
4037
->setHelp('Generates proxy classes for entity classes.');
4138
}
4239

43-
/**
44-
* {@inheritdoc}
45-
*
46-
* @return int
47-
*/
48-
protected function execute(InputInterface $input, OutputInterface $output)
40+
protected function execute(InputInterface $input, OutputInterface $output): int
4941
{
5042
$ui = new SymfonyStyle($input, $output);
5143

lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
*/
2121
class InfoCommand extends AbstractEntityManagerCommand
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
26-
protected function configure()
23+
protected function configure(): void
2724
{
2825
$this->setName('orm:info')
2926
->setDescription('Show basic information about all mapped entities')
@@ -36,12 +33,7 @@ protected function configure()
3633
);
3734
}
3835

39-
/**
40-
* {@inheritdoc}
41-
*
42-
* @return int
43-
*/
44-
protected function execute(InputInterface $input, OutputInterface $output)
36+
protected function execute(InputInterface $input, OutputInterface $output): int
4537
{
4638
$ui = new SymfonyStyle($input, $output);
4739

lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,8 @@ static function ($mappedEntity) use ($entityName) {
188188

189189
/**
190190
* Format the given value for console output
191-
*
192-
* @param mixed $value
193191
*/
194-
private function formatValue($value): string
192+
private function formatValue(mixed $value): string
195193
{
196194
if ($value === '') {
197195
return '';
@@ -233,7 +231,7 @@ private function formatValue($value): string
233231
* @return string[]
234232
* @psalm-return array{0: string, 1: string}
235233
*/
236-
private function formatField(string $label, $value): array
234+
private function formatField(string $label, mixed $value): array
237235
{
238236
if ($value === null) {
239237
$value = '<comment>None</comment>';

0 commit comments

Comments
 (0)