Passed
Push — develop ( 11996c...22f379 )
by Nikita
05:04
created

HomeController::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Gameap\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use \Illuminate\Http\Response;
7
use Gameap\Services\InfoService;
8
use Cache;
9
10
class HomeController extends Controller
11
{
12
    /**
13
     * Create a new controller instance.
14
     *
15
     * @return void
16
     */
17
    public function __construct()
18
    {
19
        $this->middleware('auth');
20
    }
21
22
    /**
23
     * Show the application dashboard.
24
     *
25
     * @return \Illuminate\Http\Response
26
     */
27
    public function index()
28
    {
29
        $latestVersion = Cache::remember('latestVersion', 3600, function () {
30
            return InfoService::latestRelease();
31
        });
32
        
33
        return view('home', compact('latestVersion'));
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('home', compact('latestVersion')) returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
34
    }
35
36
    /**
37
     * Show help information (GameAP resources etc)
38
     * @return \Illuminate\Http\Response
39
     */
40
    public function help()
41
    {
42
        return view('help');
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('help') returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
43
    }
44
45
    /**
46
     * Report a bug
47
     */
48
    public function reportBug()
49
    {
50
        return view('report_bug');
51
    }
52
53
    /**
54
     * Upgrade panel page
55
     */
56
    public function update()
57
    {
58
        $latestVersion = InfoService::latestRelease();
59
        return view('update', compact('latestVersion'));
60
    }
61
}
62