1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Umbrellio\Postgres; |
||
6 | |||
7 | use Illuminate\Database\DatabaseManager; |
||
8 | use Illuminate\Database\DatabaseServiceProvider; |
||
9 | use Illuminate\Database\DatabaseTransactionsManager; |
||
10 | use Umbrellio\Postgres\Connectors\ConnectionFactory; |
||
11 | |||
12 | class UmbrellioPostgresProvider extends DatabaseServiceProvider |
||
13 | { |
||
14 | /** |
||
15 | * @codeCoverageIgnore |
||
16 | */ |
||
17 | protected function registerConnectionServices(): void |
||
18 | { |
||
19 | $this->app->singleton('db.factory', function ($app) { |
||
20 | return new ConnectionFactory($app); |
||
21 | }); |
||
22 | |||
23 | $this->app->singleton('db', function ($app) { |
||
24 | return new DatabaseManager($app, $app['db.factory']); |
||
25 | }); |
||
26 | |||
27 | $this->app->bind('db.connection', function ($app) { |
||
28 | return $app['db']->connection(); |
||
29 | }); |
||
30 | |||
31 | $this->app->bind('db.schema', function ($app) { |
||
32 | return $app['db']->connection()->getSchemaBuilder(); |
||
33 | }); |
||
34 | |||
35 | $this->app->singleton('db.transactions', function ($app) { |
||
0 ignored issues
–
show
|
|||
36 | return new DatabaseTransactionsManager(); |
||
37 | }); |
||
38 | } |
||
39 | } |
||
40 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.