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