Skip to content

Commit b01d36e

Browse files
committed
cs fixes
1 parent 6731f53 commit b01d36e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
use Symfony\Component\Console\Input\InputInterface;
2929
use Symfony\Component\Console\Input\InputOption;
3030
use Symfony\Component\Console\Output\OutputInterface;
31-
use const E_USER_DEPRECATED;
3231
use function array_keys;
3332
use function assert;
3433
use function count;
3534
use function implode;
35+
use function is_string;
3636
use function trigger_error;
37+
use const E_USER_DEPRECATED;
3738

3839
class ReservedWordsCommand extends Command
3940
{
@@ -200,8 +201,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
200201

201202
private function getConnection(InputInterface $input) : Connection
202203
{
203-
/** @var string|null $connectionName */
204204
$connectionName = $input->getOption('connection');
205+
assert(is_string($connectionName) || $connectionName === null);
205206

206207
if ($this->connectionProvider === null) {
207208
if ($connectionName !== null) {

lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
use Symfony\Component\Console\Input\InputInterface;
1414
use Symfony\Component\Console\Input\InputOption;
1515
use Symfony\Component\Console\Output\OutputInterface;
16-
use const E_USER_DEPRECATED;
1716
use function assert;
1817
use function is_numeric;
1918
use function is_string;
2019
use function stripos;
2120
use function trigger_error;
21+
use const E_USER_DEPRECATED;
2222

2323
/**
2424
* Task for executing arbitrary SQL that can come from a file or directly from
@@ -92,8 +92,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
9292

9393
private function getConnection(InputInterface $input) : Connection
9494
{
95-
/** @var string|null $connectionName */
9695
$connectionName = $input->getOption('connection');
96+
assert(is_string($connectionName) || $connectionName === null);
9797

9898
if ($this->connectionProvider === null) {
9999
if ($connectionName !== null) {

lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
use Symfony\Component\Console\Command\Command;
1313
use Symfony\Component\Console\Helper\HelperSet;
1414
use TypeError;
15-
use const E_USER_DEPRECATED;
15+
use function assert;
1616
use function sprintf;
1717
use function trigger_error;
18+
use const E_USER_DEPRECATED;
1819

1920
/**
2021
* Handles running the Console Tools inside Symfony Console context.
@@ -49,8 +50,8 @@ public static function run($helperSetOrConnectionProvider, $commands = [])
4950

5051
$cli->setCatchExceptions(true);
5152

52-
/** @var ConnectionProvider|null $connectionProvider */
5353
$connectionProvider = null;
54+
assert($connectionProvider instanceof ConnectionProvider || $connectionProvider === null);
5455
if ($helperSetOrConnectionProvider instanceof HelperSet) {
5556
@trigger_error(sprintf('Passing an instance of "%s" as the first argument is deprecated. Pass an instance of "%s" instead.', HelperSet::class, ConnectionProvider::class), E_USER_DEPRECATED);
5657
$connectionProvider = null;

0 commit comments

Comments
 (0)