AssociationAwareController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 12
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
7
use App\Association;
8
use Illuminate\Support\Arr;
9
10
class AssociationAwareController extends Controller
11
{
12
13
    /**
14
     * @var \App\Association $association
15
     */
16
    protected $association;
17
18
    public function __construct(Request $request) {
0 ignored issues
show
Unused Code introduced by
The parameter $request 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

18
    public function __construct(/** @scrutinizer ignore-unused */ Request $request) {

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...
19
        $subdomain = Arr::first(explode('.', \Request::getHost()));
20
21
        $this->association = Association::where('subdomain', $subdomain)->first();
22
    }
23
24
}
25