Completed
Push — device_ip ( 1d928b...ddfcff )
by Tony
03:21 queued 11s
created

PortController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Dingo\Api\Http;
6
use Dingo\Api\Routing\Helpers;
7
use Illuminate\Http\Request;
8
9
class PortController extends Controller
10
{
11
    use Helpers;
12
13
    /**
14
     * Constructor
15
     */
16
    public function __construct(Request $request) {
1 ignored issue
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...
17
        $this->middleware('auth');
18
    }
19
20
    /**
21
     * Display a listing of the resource.
22
     *
23
     * @return \Illuminate\Http\Response
24
     */
25
    public function index()
26
    {
27
        $api = $this->api->be(auth()->user());
0 ignored issues
show
Bug introduced by
The method user() does not seem to exist on object<Illuminate\Contracts\Auth\Factory>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
        $ports = $api->get('/api/ports?include=device');
29
30
        return view('ports.list', ['ports'=>$ports]);
31
    }
32
33
    /**
34
     * Display the specified resource.
35
     *
36
     * @param  int  $id
37
     * @return \Illuminate\Http\Response
38
     */
39
    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...
40
    {
41
        // show a single device
42
    }
43
44
    /**
45
     * Show the form for editing the specified resource.
46
     *
47
     * @param  int  $id
48
     * @return \Illuminate\Http\Response
49
     */
50
    public function edit($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...
51
    {
52
        //edit device form??
53
    }
54
55
    /**
56
     * Update the specified resource in storage.
57
     *
58
     * @param  \Illuminate\Http\Request  $request
59
     * @param  int  $id
60
     * @return \Illuminate\Http\Response
61
     */
62
    public function update(Request $request, $id)
1 ignored issue
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...
63
    {
64
        //process device modify
65
    }
66
}
67