Completed
Push — master ( 0af765...4a87b5 )
by claudio
03:49
created

EmployeesController::destroy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace plunner\Http\Controllers\Companies;
4
5
use Illuminate\Http\Request;
6
7
use plunner\Http\Requests;
8
use plunner\Http\Controllers\Controller;
9
use Tymon\JWTAuth\Facades\JWTAuth;
10
use plunner\Company;
11
12 View Code Duplication
class EmployeesController extends Controller
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /**
15
     * @var \plunner\Company
16
     */
17
    private $user;
0 ignored issues
show
Unused Code introduced by
The property $user is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
18
19
    /**
20
     * ExampleController constructor.
21
     */
22
    public function __construct()
23
    {
24
        config(['auth.model' => \plunner\Company::class]);
25
        config(['jwt.user' => \plunner\Company::class]);
26
        $this->middleware('jwt.authandrefresh:mode-cn');
27
    }
28
29
30
    /**
31
     * Display a listing of the resource.
32
     *
33
     * @return \Illuminate\Http\Response
34
     */
35
    public function index()
36
    {
37
        //
38
        /**
39
         * @var $company Company
40
         */
41
        $company = JWTAuth::getUserModel();
42
        return $company->employees;
43
    }
44
45
    /**
46
     * Store a newly created resource in storage.
47
     *
48
     * @param  \Illuminate\Http\Request  $request
49
     * @return \Illuminate\Http\Response
50
     */
51
    public function store(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
    {
53
        //
54
    }
55
56
    /**
57
     * Display the specified resource.
58
     *
59
     * @param  int  $id
60
     * @return \Illuminate\Http\Response
61
     */
62
    public function show($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
    {
64
        //
65
    }
66
67
    /**
68
     * Update the specified resource in storage.
69
     *
70
     * @param  \Illuminate\Http\Request  $request
71
     * @param  int  $id
72
     * @return \Illuminate\Http\Response
73
     */
74
    public function update(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
75
    {
76
        //
77
    }
78
79
    /**
80
     * Remove the specified resource from storage.
81
     *
82
     * @param  int  $id
83
     * @return \Illuminate\Http\Response
84
     */
85
    public function destroy($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
86
    {
87
        //
88
    }
89
}
90