Completed
Push — master ( cd2ebb...7ad1ba )
by Tony
11s
created

WidgetController   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 29.4%
Metric Value
wmc 8
lcom 0
cbo 2
dl 0
loc 84
ccs 5
cts 17
cp 0.294
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A index() 0 5 1
A create() 0 4 1
A store() 0 4 1
A show() 0 4 1
A edit() 0 4 1
A update() 0 4 1
A destroy() 0 4 1
1
<?php
2
3
namespace App\Api\Controllers;
4
5
use App\Models\User;
6
use App\Models\Widgets;
7
use Illuminate\Http\Request;
8
9
class WidgetController extends Controller
10
{
11 2
    public function __construct() {
12
13 2
    }
14
15
    /**
16
     * Display a listing of all widgets
17
     *
18
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Database\Eloquent\Collection?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
19
     */
20 2
    public function index(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...
21
    {
22 2
        $widget = Widgets::all();
23 2
        return $widget;
24
    }
25
26
    /**
27
     * Show the form for creating a new resource.
28
     *
29
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
30
     */
31
    public function create()
32
    {
33
        //
34
    }
35
36
    /**
37
     * Store a newly created resource in storage.
38
     *
39
     * @param  \Illuminate\Http\Request  $request
40
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
41
     */
42
    public function store(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...
43
    {
44
        //
45
    }
46
47
    /**
48
     * Display the specified resource.
49
     *
50
     * @param  int  $id
51
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
52
     */
53
    public function show(Request $request, $id)
2 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...
54
    {
55
        //
56
    }
57
58
    /**
59
     * Show the form for editing the specified resource.
60
     *
61
     * @param  int  $id
62
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
63
     */
64
    public function edit($id)
1 ignored issue
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...
65
    {
66
        //
67
    }
68
69
    /**
70
     * Update the specified resource in storage.
71
     *
72
     * @param  \Illuminate\Http\Request  $request
73
     * @param  int  $id
74
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
75
     */
76
    public function update(Request $request, $id)
2 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...
77
    {
78
        //
79
    }
80
81
    /**
82
     * Remove the specified resource from storage.
83
     *
84
     * @param  int  $id
85
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
86
     */
87
    public function destroy($id)
1 ignored issue
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...
88
    {
89
        //
90
    }
91
92
}
93