Failed Conditions
Pull Request — master (#1861)
by k-yamamura
474:27 queued 464:07
created

EccubeWebProcessor   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 13
lcom 1
cbo 1
dl 0
loc 44
ccs 14
cts 16
cp 0.875
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRequestUri() 0 4 2
A getClientIp() 0 4 2
A getReferer() 0 4 2
A getMethod() 0 4 2
A getHost() 0 4 2
A getUserAgent() 0 4 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
namespace Eccube\Monolog\Processor;
25
26
use Monolog\Processor\WebProcessor;
27
28
/**
29
 * WebProcessor拡張クラス
30
 * protectedであるプロパティをpublicに変更する
31
 *
32
 * @package Eccube\Monolog\Processor
33
 */
34
class EccubeWebProcessor extends WebProcessor
35
{
36
37
    /**
38
     * @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data
0 ignored issues
show
introduced by
Expected 2 spaces after parameter name; 1 found
Loading history...
39
     * @param array|null $extraFields Extra field names to be added (all available by default)
0 ignored issues
show
introduced by
Expected 9 spaces after parameter type; 1 found
Loading history...
40
     */
41 1062
    public function __construct($serverData = null, array $extraFields = null)
42
    {
43 1062
        $extraFields = array('user_agent' =>'HTTP_USER_AGENT');
44 1062
        parent::__construct($serverData, $extraFields);
45 1062
    }
46
47 1059
    public function getRequestUri()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
48
    {
49 1059
        return isset($this->serverData['REQUEST_URI']) ? $this->serverData['REQUEST_URI'] : null;
50
    }
51
52 1059
    public function getClientIp()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
53
    {
54 1059
        return isset($this->serverData['REMOTE_ADDR']) ? $this->serverData['REMOTE_ADDR'] : null;
55
    }
56
57 1059
    public function getReferer()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
58
    {
59 1059
        return isset($this->serverData['HTTP_REFERER']) ? $this->serverData['HTTP_REFERER'] : null;
60
    }
61
62 1059
    public function getMethod()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
63
    {
64 1059
        return isset($this->serverData['REQUEST_METHOD']) ? $this->serverData['REQUEST_METHOD'] : null;
65
    }
66
67
    public function getHost()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
68
    {
69
        return isset($this->serverData['SERVER_NAME']) ? $this->serverData['SERVER_NAME'] : null;
70
    }
71
72 1059
    public function getUserAgent()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
73
    {
74 1059
        return isset($this->serverData['HTTP_USER_AGENT']) ? $this->serverData['HTTP_USER_AGENT'] : null;
75
    }
76
77
}
78