| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 162 | public static function new(?string $url = null) : self |
|
| 16 | { |
||
| 17 | 162 | if ($url !== null) { |
|
| 18 | 160 | return new self( |
|
| 19 | 160 | sprintf( |
|
| 20 | "The options 'driver' or 'driverClass' are mandatory if a connection URL without scheme " |
||
| 21 | 10 | . 'is given to DriverManager::getConnection(). Given URL: %s', |
|
| 22 | 160 | $url |
|
| 23 | ) |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | 127 | return new self( |
|
| 28 | "The options 'driver' or 'driverClass' are mandatory if no PDO " |
||
| 29 | 127 | . 'instance is given to DriverManager::getConnection().' |
|
| 30 | ); |
||
| 33 |