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