Passed
Push — master ( 7bc374...cf39f3 )
by Arthur
05:05
created

UserController   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Test Coverage

Coverage 23.08%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 66
ccs 3
cts 13
cp 0.2308
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A destroy() 0 3 1
A index() 0 3 1
A show() 0 5 1
A store() 0 3 1
A create() 0 3 1
A update() 0 3 1
1
<?php
2
3
namespace Modules\User\Http\Controllers;
4
5
use Foundation\Abstracts\Controller\Controller;
6
use Illuminate\Http\JsonResponse;
7
use Illuminate\Http\Request;
8
use Modules\User\Entities\User;
9
10
class UserController extends Controller
11
{
12
    /**
13
     * Display a listing of the resource.
14
     *
15
     * @return JsonResponse
16
     */
17
    public function index()
18
    {
19
        return \response()->json();
20
    }
21
22
    /**
23
     * Show the form for creating a new resource.
24
     *
25
     * @return JsonResponse
26
     */
27
    public function create()
28
    {
29
        return \response()->json();
30
    }
31
32
    /**
33
     * Store a newly created resource in storage.
34
     *
35
     * @param Request $request
36
     *
37
     * @return JsonResponse
38
     */
39
    public function store(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

39
    public function store(/** @scrutinizer ignore-unused */ Request $request)

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

Loading history...
40
    {
41
        return \response()->json();
42
    }
43
44
    /**
45
     * Show the specified resource.
46
     *
47
     * @return JsonResponse
48
     */
49 1
    public function show()
50
    {
51 1
        $this->authorize('access', get_authenticated_user());
52
53 1
        return \response()->json(\Auth::user()->toArray());
54
    }
55
56
    /**
57
     * Update the specified resource in storage.
58
     *
59
     * @param Request $request
60
     *
61
     * @return JsonResponse
62
     */
63
    public function update(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

63
    public function update(/** @scrutinizer ignore-unused */ Request $request)

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

Loading history...
64
    {
65
        return \response()->json();
66
    }
67
68
    /**
69
     * Remove the specified resource from storage.
70
     *
71
     * @return JsonResponse
72
     */
73
    public function destroy()
74
    {
75
        return \response()->json();
76
    }
77
}
78