| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class FeatureDetection |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Resolve the connection via bindings. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | const CONNECTION_RESOLVER_BINDINGS = 'bindings'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Resolve the connection via the connection resolver method. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | const CONNECTION_RESOLVER_METHOD = 'connection-method'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Determine the driver for resolving the connection. |
||
| 25 | * |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | 2747 | public function connectionResolverDriver() |
|
| 29 | { |
||
| 30 | 2747 | if (method_exists(Connection::class, 'resolverFor')) { |
|
| 31 | 1066 | return self::CONNECTION_RESOLVER_METHOD; |
|
| 32 | } |
||
| 33 | |||
| 34 | 1681 | return self::CONNECTION_RESOLVER_BINDINGS; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Check if the connection resolver method is of the given type. |
||
| 39 | * |
||
| 40 | * @param string $driver |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 2278 | public function isConnectionResolver($driver) |
|
| 47 | } |
||
| 48 | } |
||
| 49 |