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

PortController   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 58
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A index() 0 7 1
A show() 0 4 1
A edit() 0 4 1
A update() 0 4 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