| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | class DbService |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @return ConnectionInterface |
||
| 15 | */ |
||
| 16 | 73 | public function connection(): ConnectionInterface |
|
| 17 | { |
||
| 18 | 73 | return DB::connection(config('wallet.database.connection')); |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Execute a Closure within a transaction. |
||
| 23 | * |
||
| 24 | * @param Closure $callback |
||
| 25 | * @param int $attempts |
||
| 26 | * @return mixed |
||
| 27 | * |
||
| 28 | * @throws \Throwable |
||
| 29 | */ |
||
| 30 | 73 | public function transaction(Closure $callback, $attempts = 1) |
|
| 31 | { |
||
| 32 | 73 | return $this->connection()->transaction($callback, $attempts); |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Get a new raw query expression. |
||
| 37 | * |
||
| 38 | * @param mixed $value |
||
| 39 | * @return Expression |
||
| 40 | */ |
||
| 41 | public function raw($value): Expression |
||
| 44 | } |
||
| 45 | |||
| 46 | } |
||
| 47 |