AuthComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A compose() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of laravel.su package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
declare(strict_types=1);
10
11
namespace App\Views\Composers;
12
13
use Illuminate\Contracts\View\View;
14
use Illuminate\Contracts\Auth\Authenticatable;
15
16
/**
17
 * Class AuthComposer.
18
 */
19
class AuthComposer
20
{
21
    /**
22
     * @var Authenticatable|null
23
     */
24
    private $auth;
25
26
    /**
27
     * AuthComposer constructor.
28
     *
29
     * @param Authenticatable|null $auth
30
     */
31
    public function __construct(Authenticatable $auth = null)
32
    {
33
        $this->auth = $auth;
34
    }
35
36
    /**
37
     * @param View $view
38
     */
39
    public function compose(View $view): void
40
    {
41
        $view->with('auth', $this->auth);
42
    }
43
}
44