Issues (16)

src/UmbrellioPostgresProvider.php (1 issue)

Severity
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
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

35
        $this->app->singleton('db.transactions', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
            return new DatabaseTransactionsManager();
37
        });
38
    }
39
}
40