for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Umbrellio\Postgres;
use Illuminate\Database\DatabaseManager;
use Illuminate\Database\DatabaseServiceProvider;
use Illuminate\Database\DatabaseTransactionsManager;
use Umbrellio\Postgres\Connectors\ConnectionFactory;
class UmbrellioPostgresProvider extends DatabaseServiceProvider
{
/**
* @codeCoverageIgnore
*/
protected function registerConnectionServices(): void
$this->app->singleton('db.factory', function ($app) {
return new ConnectionFactory($app);
});
$this->app->singleton('db', function ($app) {
return new DatabaseManager($app, $app['db.factory']);
$this->app->bind('db.connection', function ($app) {
return $app['db']->connection();
$this->app->bind('db.schema', function ($app) {
return $app['db']->connection()->getSchemaBuilder();
$this->app->singleton('db.transactions', function ($app) {
$app
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$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.
return new DatabaseTransactionsManager();
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.