| Total Complexity | 4 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class DsnConnectionConfig extends ConnectionConfig implements ProvidesSourceString |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var string|null |
||
| 21 | */ |
||
| 22 | private ?string $database = null; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var non-empty-string |
||
|
|
|||
| 26 | * @psalm-allow-private-mutation |
||
| 27 | */ |
||
| 28 | public string $dsn; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param non-empty-string|\Stringable $dsn |
||
| 32 | * @param array $options |
||
| 33 | */ |
||
| 34 | public function __construct( |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritDoc} |
||
| 46 | */ |
||
| 47 | public function getSourceString(): string |
||
| 48 | { |
||
| 49 | /** @psalm-suppress ArgumentTypeCoercion */ |
||
| 50 | return $this->database ??= \substr($this->getDsn(), \strlen($this->getName()) + 1); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritDoc} |
||
| 55 | */ |
||
| 56 | public function getDsn(): string |
||
| 59 | } |
||
| 60 | |||
| 61 | public static function __set_state(array $an_array): object |
||
| 69 |