SystemController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 95.83%

Importance

Changes 0
Metric Value
dl 0
loc 53
ccs 23
cts 24
cp 0.9583
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getSystemInfo() 0 18 1
A index() 0 22 2
1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
25
namespace Eccube\Controller\Admin\Setting\System;
26
27
use Eccube\Application;
28
use Eccube\Common\Constant;
29
30
class SystemController
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
31
{
32
33
    private $maintitle;
0 ignored issues
show
Unused Code introduced by
The property $maintitle is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
34
35
    private $subtitle;
0 ignored issues
show
Unused Code introduced by
The property $subtitle is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
36
37
    public function __construct()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
38
    {
39
    }
40
41 2
    public function index(Application $app)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
42
    {
43 2
        switch ($app['request']->get('mode')) {
44 2
            case 'info':
45 1
                ob_start();
46 1
                phpinfo();
47 1
                $phpinfo = ob_get_contents();
48 1
                ob_end_clean();
49
50 1
                return $phpinfo;
51
52
               break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
53
            default:
54 1
                break;
55
        }
56
57 1
        $this->arrSystemInfo = $this->getSystemInfo($app);
58
59 1
        return $app->render('Setting/System/system.twig', array(
60 1
            'arrSystemInfo' => $this->arrSystemInfo,
61
        ));
62
    }
63
64 1
     public function getSystemInfo(Application $app)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
65
     {
66 1
        $system = $app['eccube.service.system'];
67 1
        $server = $app['request'];
68
69
        $arrSystemInfo = array(
70 1
            array('title' => 'EC-CUBE',     'value' => Constant::VERSION),
71 1
            array('title' => 'サーバーOS',    'value' => php_uname()),
72 1
            array('title' => 'DBサーバー',    'value' => $system->getDbversion()),
73 1
            array('title' => 'WEBサーバー',   'value' => $server->server->get("SERVER_SOFTWARE")),
74
        );
75
76 1
        $value = phpversion() . ' (' . implode(', ', get_loaded_extensions()) . ')';
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
77 1
        $arrSystemInfo[] = array('title' => 'PHP', 'value' => $value);
78 1
        $arrSystemInfo[] = array('title' => 'HTTPユーザーエージェント', 'value' => $server->headers->get('User-Agent'));
79
80 1
        return $arrSystemInfo;
81
     }
82
}
83