Issues (172)

app/Service/MixedConnection.php (3 issues)

Severity
1
<?php
2
3
namespace App\Service;
4
5
use Illuminate\Support\Facades\DB;
6
use LaravelEnso\Multitenancy\Enums\Connections;
7
8
class MixedConnection
9
{
10
    public static function set($user, $tenant)
0 ignored issues
show
The parameter $user 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

10
    public static function set(/** @scrutinizer ignore-unused */ $user, $tenant)

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...
The parameter $tenant 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

10
    public static function set($user, /** @scrutinizer ignore-unused */ $tenant)

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...
11
    {
12
        // if ($tenant) {
13
        //     self::connection(Connections::Tenant);
14
        // } else {
15
        //     self::connection('mysql');
16
        // }
17
        // // This is test for tenant db
18
        // // self::connection(Connections::Tenant);
19
20
        // // $key = 'database.default';
21
        // // $value = Connections::Mixed;
22
        // // config([$key => $value]);
23
24
        // DB::purge(Connections::Mixed);
25
26
        // DB::reconnect(Connections::Mixed);
27
    }
28
29
    private static function connection($connection)
0 ignored issues
show
The method connection() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
30
    {
31
        $key = 'database.connections.'.Connections::Mixed.'.database';
32
        $value = config("database.connections.{$connection}.database");
33
        error_log('+++++++++++++++++++++++++++++++++++'.$value);
34
        config([$key => $value]);
35
    }
36
}
37