Skip to content

Commit 7b788ff

Browse files
committed
Fix type conversion of CLI options
1 parent afc7299 commit 7b788ff

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Command/Helper/DoctrineCommandHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public static function setApplicationHelper(Application $application, InputInter
3333
$managerNames = $doctrine->getManagerNames();
3434

3535
if ($input->getOption('db') !== null || count($managerNames) === 0) {
36-
self::setApplicationConnection($application, (string) $input->getOption('db'));
36+
self::setApplicationConnection($application, $input->getOption('db'));
3737
} else {
38-
self::setApplicationEntityManager($application, (string) $input->getOption('em'));
38+
self::setApplicationEntityManager($application, $input->getOption('em'));
3939
}
4040

4141
if ($input->getOption('shard') === null) {
@@ -61,6 +61,6 @@ public static function setApplicationHelper(Application $application, InputInter
6161
));
6262
}
6363

64-
$connection->connect((string) $input->getOption('shard'));
64+
$connection->connect($input->getOption('shard'));
6565
}
6666
}

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
# This is due to a bug in DoctrineBundle
4+
- '~Parameter \#2 \$connName of static method Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DoctrineCommandHelper::setApplicationConnection\(\) expects string, array\<string\>\|bool\|string\|null given\.~'
5+
- '~Parameter \#2 \$emName of static method Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DoctrineCommandHelper::setApplicationEntityManager\(\) expects string, array\<string\>\|bool\|string\|null given\.~'
16
includes:
27
- vendor/phpstan/phpstan-strict-rules/rules.neon

0 commit comments

Comments
 (0)