Completed
Pull Request — master (#82)
by Brandon
02:15
created

SensorController::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php 
2
3
namespace App\Http\Controllers;
4
5
use App\Sensor;
6
use App\DataTables\SensorDataTable;
7
use Illuminate\Http\Request;
8
9 View Code Duplication
class SensorController 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...
10
{
11
    /**
12
    * Create a new controller instance.
13
    *
14
    * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
15
    */
16
    public function __construct()
17
    {
18
        $this->middleware('auth');
19
    }
20
21
    /**
22
    * Display a listing of the resource.
23
    *
24
    * @return Response
25
    */
26
    public function index(SensorDataTable $dataTable)
27
    {
28
        return $dataTable->render('sensor.index');
29
    }
30
31
    /**
32
    * Show the form for creating a new resource.
33
    *
34
    * @return Response
35
    */
36
    public function create()
37
    {
38
        return view('sensor.create');
39
    }
40
41
    /**
42
    * Store a newly created resource in storage.
43
    *
44
    * @return Response
45
    */
46
    public function store()
47
    {
48
    
49
    }
50
51
    /**
52
    * Display the specified resource.
53
    *
54
    * @param  int  $id
55
    * @return Response
56
    */
57
    public function show(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...
58
    {
59
        $sensor = Sensor::findOrFail($id);
60
61
        return view('sensor.show', [ 'sensor' => $sensor ]);
62
    }
63
64
    /**
65
    * Show the form for editing the specified resource.
66
    *
67
    * @param  int  $id
68
    * @return Response
69
    */
70
    public function edit(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...
71
    {
72
        $sensor = Sensor::findOrFail($id);
73
        
74
        return view('sensor.edit', [ 'sensor' => $sensor ]);
75
    }
76
77
    /**
78
    * Update the specified resource in storage.
79
    *
80
    * @param  int  $id
81
    * @return Response
82
    */
83
    public function update($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...
84
    {
85
    
86
    }
87
88
    /**
89
    * Remove the specified resource from storage.
90
    *
91
    * @param  int  $id
92
    * @return Response
93
    */
94
    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...
95
    {
96
    
97
    }
98
99
}
100