ExportController   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 8
c 1
b 0
f 0
dl 0
loc 57
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 3 1
A destroy() 0 3 1
A update() 0 4 1
A show() 0 3 1
A save() 0 4 1
1
<?php
2
3
namespace Ijeffro\Laralocker\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use Ijeffro\Laralocker\Facades\LearningLocker;
7
8
class ExportController extends Controller
9
{
10
    /**
11
     * Display a listing of the resource.
12
     *
13
     * @return \Illuminate\Http\Response
14
     */
15
    public function index()
16
    {
17
        return LearningLocker::exports()->get();
0 ignored issues
show
Bug introduced by
The method exports() does not exist on Ijeffro\LaraLocker\Facades\LearningLocker. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

17
        return LearningLocker::/** @scrutinizer ignore-call */ exports()->get();
Loading history...
18
    }
19
20
    /**
21
     * Display the specified resource.
22
     *
23
     * @param  int  $id
24
     * @return \Illuminate\Http\Response
25
     */
26
    public function show($id)
27
    {
28
        return LearningLocker::export($id)->get();
0 ignored issues
show
Bug introduced by
The method export() does not exist on Ijeffro\LaraLocker\Facades\LearningLocker. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

28
        return LearningLocker::/** @scrutinizer ignore-call */ export($id)->get();
Loading history...
29
    }
30
31
    /**
32
     * Store a newly created resource in storage.
33
     *
34
     * @param  \Illuminate\Http\Request  $request
35
     * @return \Illuminate\Http\Response
36
     */
37
    public function save(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

37
    public function save(/** @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...
38
    {
39
        $data = request()->all();
40
        return LearningLocker::export()->create($data);
41
    }
42
43
    /**
44
     * Update the specified resource in storage.
45
     *
46
     * @param  \Illuminate\Http\Request $request
47
     * @param  int  $id
48
     * @return \Illuminate\Http\Response
49
     */
50
    public function update(Request $request, $id)
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

50
    public function update(/** @scrutinizer ignore-unused */ Request $request, $id)

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...
51
    {
52
        $data = request()->all();
53
        return LearningLocker::export($id)->update($data);
54
    }
55
56
    /**
57
     * Remove the specified resource from storage.
58
     *
59
     * @param  int  $id
60
     * @return \Illuminate\Http\Response
61
     */
62
    public function destroy($id)
63
    {
64
        return LearningLocker::export($id)->delete();
65
    }
66
67
68
}
69