Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | class DsnConnectionConfig extends ConnectionConfig implements ProvidesSourceString |
||
18 | { |
||
19 | /** |
||
20 | * @var non-empty-string |
||
|
|||
21 | * |
||
22 | * @psalm-allow-private-mutation |
||
23 | */ |
||
24 | public string $dsn; |
||
25 | |||
26 | private ?string $database = null; |
||
27 | |||
28 | /** |
||
29 | * @param non-empty-string|\Stringable $dsn |
||
30 | */ |
||
31 | public function __construct( |
||
39 | } |
||
40 | |||
41 | public function getSourceString(): string |
||
42 | { |
||
43 | /** @psalm-suppress ArgumentTypeCoercion */ |
||
44 | return $this->database ??= \substr($this->getDsn(), \strlen($this->getName()) + 1); |
||
45 | } |
||
46 | |||
47 | public function getDsn(): string |
||
50 | } |
||
51 | } |
||
52 |