Completed
Push — master ( 46aff2...b271b8 )
by wen
02:45
created

AdminController::restore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
4
namespace Sco\Admin\Http\Controllers;
5
6
use Illuminate\Routing\Controller;
7
use Sco\Admin\Contracts\Config as ConfigContract;
8
9
class AdminController extends Controller
10
{
11
    public function getList(ConfigContract $config)
12
    {
13
        $model = $config->getModel();
14
        return $model->get();
15
    }
16
17
    public function config(ConfigContract $config)
18
    {
19
        return $config->getConfigs();
20
    }
21
22
    public function create()
23
    {
24
    }
25
26
    public function store()
27
    {
28
    }
29
30
    public function edit(ConfigContract $config, $id)
31
    {
32
        dd($config->getModel()->find($id)) ;
0 ignored issues
show
Bug introduced by
The method find() does not seem to exist on object<Sco\Admin\Config\ModelConfig>.

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...
33
    }
34
35
    public function update()
36
    {
37
    }
38
39
    public function delete(ConfigContract $config, $id)
40
    {
41
        $config->getModel()->delete($id);
42
        return response()->json(['message' => 'ok']);
43
    }
44
45
    public function batchDelete(ConfigContract $config)
0 ignored issues
show
Unused Code introduced by
The parameter $config 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...
46
    {
47
    }
48
49
    public function destroy(ConfigContract $config, $id)
50
    {
51
        $config->getModel()->destroy($id);
52
        return response()->json(['message' => 'ok']);
53
    }
54
55
    public function restore(ConfigContract $config, $id)
56
    {
57
        $config->getModel()->restore($id);
0 ignored issues
show
Bug introduced by
The method restore() does not seem to exist on object<Sco\Admin\Config\ModelConfig>.

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...
58
        return response()->json(['message' => 'ok']);
59
    }
60
}
61