Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class FileConnectionConfig extends ConnectionConfig implements ProvidesSourceString |
||
17 | { |
||
18 | /** |
||
19 | * @param string $database The pathname to the SQLite database file. |
||
20 | * - In case of keyword ":memory:" {@see MemoryConnectionConfig}. |
||
21 | * - In case of empty string value {@see TempFileConnectionConfig}. |
||
22 | * @param array $options |
||
23 | */ |
||
24 | 26 | public function __construct( |
|
25 | public string $database = '', |
||
26 | array $options = [] |
||
27 | ) { |
||
28 | 26 | parent::__construct($options); |
|
29 | 26 | } |
|
30 | |||
31 | /** |
||
32 | * Returns the SQLite-specific PDO DataSourceName, that looks like: |
||
33 | * <code> |
||
34 | * sqlite:/path/to/database.db |
||
35 | * </code> |
||
36 | * |
||
37 | * {@inheritDoc} |
||
38 | */ |
||
39 | 8 | public function getDsn(): string |
|
40 | { |
||
41 | 8 | return \sprintf('%s:%s', $this->getName(), $this->database); |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | 2 | public function getSourceString(): string |
|
50 | } |
||
51 | |||
52 | public static function __set_state(array $state): self |
||
57 |