Completed
Pull Request — develop (#57)
by Tony
07:09
created

SettingsController::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Copyright (C) 2016 Tony Murray <[email protected]>
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
18
namespace App\Http\Controllers;
19
20
use App\Http\Requests;
21
use App\Models\DbConfig;
22
use Illuminate\Http\Request;
23
use Settings;
24
25
class SettingsController extends Controller
26
{
27
    /**
28
     * Constructor
29
     */
30
    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...
31
    {
32
        $this->middleware('auth');
33
    }
34
35
    /**
36
     * Display a listing of the resource.
37
     *
38
     * @return \Illuminate\Http\Response
39
     */
40
    public function index()
41
    {
42
//        return view('settings.list', ['settings' => Config::all()]);
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
43
44
//        $settings[] = config('config.snmp.v3.0');
0 ignored issues
show
Unused Code Comprehensibility introduced by
59% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
45
//        Config::set('config.snmp.v3.0.authlevel', 'changed');
46
//        $settings[] = config()->get('config.snmp.v3.0.authlevel');
47
//        config()->set('config.snmp.v3.0', ['authlevel' => 'changed2', 'authname' => config('config.snmp.v3.0.authname'), 'authpass' => 'changed2', 'authalgo' => 'changed2', 'cryptopass' => 'changed2', 'cryptoalgo' => 'changed2']);
48
//        $settings[] = config('config.snmp.v3');
49
//        $settings[] = Config::get('config.snmp.v3.0.authlevel');
50
51
//        $settings[] = Settings::get('email_backend');
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
52
        $settings = Settings::get('snmp');
53
//        $settings[] = Settings::get('alert');
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
54
//        $settings[] = Settings::get('snmp');
55
//        $settings[] = Settings::get(null);  // same as all, but only gets db settings...
56
//        Settings::set('custom', 'something');
57
//        $settings[] = Settings::get('custom');
58
//        $settings = Settings::all();
59
60
        return view('settings.list', ['settings' => $settings]);
61
    }
62
63
    /**
64
     * Show the form for creating a new resource.
65
     *
66
     * @return \Illuminate\Http\Response
67
     */
68
    public function create()
69
    {
70
        //
71
    }
72
73
    /**
74
     * Store a newly created resource in storage.
75
     *
76
     * @param  \Illuminate\Http\Request $request
77
     * @return \Illuminate\Http\Response
78
     */
79
    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...
80
    {
81
        //
82
    }
83
84
    /**
85
     * Display the specified resource.
86
     *
87
     * @param  int $id
88
     * @return \Illuminate\Http\Response
89
     */
90
    public function show($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...
91
    {
92
        //
93
    }
94
95
    /**
96
     * Show the form for editing the specified resource.
97
     *
98
     * @param  int $id
99
     * @return \Illuminate\Http\Response
100
     */
101
    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...
102
    {
103
        //
104
    }
105
106
    /**
107
     * Update the specified resource in storage.
108
     *
109
     * @param  \Illuminate\Http\Request $request
110
     * @param  int $id
111
     * @return \Illuminate\Http\Response
112
     */
113
    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...
114
    {
115
        //
116
    }
117
118
    /**
119
     * Remove the specified resource from storage.
120
     *
121
     * @param  int $id
122
     * @return \Illuminate\Http\Response
123
     */
124
    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...
125
    {
126
        //
127
    }
128
}
129