Completed
Push — develop ( 335c93...e4583a )
by Mohamed
12:58
created

Controller::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tinyissue\Http\Controllers;
13
14
use Illuminate\Foundation\Bus\DispatchesJobs;
15
use Illuminate\Routing\Controller as BaseController;
16
use Illuminate\Foundation\Validation\ValidatesRequests;
17
use Illuminate\Contracts\Auth\Guard;
18
use Tinyissue\Model;
19
20
/**
21
 * Controller is an abstract class for the controller classes.
22
 *
23
 * @author Mohamed Alsharaf <[email protected]>
24
 */
25
abstract class Controller extends BaseController
26
{
27
    use DispatchesJobs, ValidatesRequests;
28
29
    /**
30
     * Current logged in user.
31
     *
32
     * @var Guard
33
     */
34
    protected $auth;
35
36
    /**
37
     * Constructor, inject an instance of logged user.
38
     *
39
     * @param \Illuminate\Contracts\Auth\Guard $auth
40
     */
41 56
    public function __construct(Guard $auth)
42
    {
43 56
        $this->auth = $auth;
44 56
    }
45
}
46