Index   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 2 1
A getPerson() 0 7 1
1
<?php
2
3
namespace App\Http\Controllers\Personalias;
4
5
use App\Service\Tenant;
6
use Illuminate\Http\Request;
7
use Illuminate\Routing\Controller;
8
use Illuminate\Support\Facades\Auth;
9
use Illuminate\Support\Facades\DB;
10
use LaravelEnso\Multitenancy\Enums\Connections;
0 ignored issues
show
Bug introduced by
The type LaravelEnso\Multitenancy\Enums\Connections was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
class Index extends Controller
13
{
14
    public function __invoke(Request $request)
15
    {
16
    }
17
18
    public function getPerson()
19
    {
20
        $tenant = Auth::user()->company();
0 ignored issues
show
Bug introduced by
The method company() does not exist on Illuminate\Contracts\Auth\Authenticatable. It seems like you code against a sub-type of Illuminate\Contracts\Auth\Authenticatable such as Illuminate\Foundation\Auth\User. ( Ignorable by Annotation )

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

20
        $tenant = Auth::user()->/** @scrutinizer ignore-call */ company();
Loading history...
21
        Tenant::set($tenant);
22
        $company = Tenant::get();
0 ignored issues
show
Unused Code introduced by
The assignment to $company is dead and can be removed.
Loading history...
23
24
        return DB::connection(Connections::Tenant)->table('people')->get();
25
    }
26
}
27