GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ThemeComposer::compose()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 3
nop 1
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use App\Models\Theme;
6
use Illuminate\Support\Facades\Auth;
7
use Illuminate\View\View;
8
9
class ThemeComposer
10
{
11
    protected $user;
12
    protected $theme;
13
14
    public function __construct()
15
    {
16
        $this->user = Auth::user();
17
    }
18
19
    /**
20
     * Bind data to the view.
21
     *
22
     * @param View $view
23
     *
24
     * @return void
25
     */
26
    public function compose(View $view)
27
    {
28
        $theme = null;
29
30
        if (Auth::check()) {
31
            $user = $this->user;
32
33
            if ($user->profile) {
0 ignored issues
show
Bug introduced by
Accessing profile on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
34
                $theme = Theme::find(1);
35
            }
36
        }
37
38
        $view->with('theme', $theme);
39
    }
40
}
41