Skip to content

Commit a8f958d

Browse files
committed
MISC for core
1 parent a2a3be1 commit a8f958d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Driver/Pdo/DsnHelper.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
class DsnHelper
1111
{
1212
/**
13-
* extractDsn
14-
*
15-
* @param string $dsn
13+
* @param string $dsn
14+
* @param string|null $type
1615
*
1716
* @return array
1817
*/
19-
public static function extract(string $dsn): array
18+
public static function extract(string $dsn, ?string &$type = null): array
2019
{
20+
if (str_contains($dsn, ':')) {
21+
[$type, $dsn] = explode(':', $dsn);
22+
}
23+
2124
// Parse DSN to array
2225
$dsn = str_replace(';', "\n", $dsn);
2326

src/Manager/AbstractMetaManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
abstract class AbstractMetaManager
1414
{
1515
/**
16-
* @var string
16+
* @var ?string
1717
*/
1818
protected ?string $name = null;
1919

@@ -43,7 +43,7 @@ public function getDb(): DatabaseAdapter
4343
}
4444

4545
/**
46-
* @return string
46+
* @return ?string
4747
*/
4848
public function getName(): ?string
4949
{

0 commit comments

Comments
 (0)