Completed
Pull Request — master (#128)
by Fabien
09:03
created

Profile   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 0
dl 0
loc 80
ccs 16
cts 18
cp 0.8889
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPlugin() 0 4 1
A getRequest() 0 4 1
A getResponse() 0 4 1
A setResponse() 0 4 1
A isFailed() 0 4 1
A setFailed() 0 4 1
1
<?php
2
3
namespace Http\HttplugBundle\Collector;
4
5
/**
6
 * A Profile holds representation of what goes in an plugin (request) and what goes out (response and failure state).
7
 *
8
 * @author Fabien Bourigault <[email protected]>
9
 *
10
 * @internal
11
 */
12
final class Profile
13
{
14
    /**
15
     * @var string
16
     */
17
    private $plugin;
18
19
    /**
20
     * @var string
21
     */
22
    private $request;
23
24
    /**
25
     * @var string
26
     */
27
    private $response;
28
29
    /**
30
     * @var bool
31
     */
32
    private $failed = false;
33
34
    /**
35
     * @param string $plugin
36
     * @param string $request
37
     */
38 4
    public function __construct($plugin, $request)
39
    {
40 4
        $this->plugin = $plugin;
41 4
        $this->request = $request;
42 4
    }
43
44
    /**
45
     * @return string
46
     */
47 1
    public function getPlugin()
48
    {
49 1
        return $this->plugin;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 1
    public function getRequest()
56
    {
57 1
        return $this->request;
58
    }
59
60
    /**
61
     * @return string
62
     */
63 1
    public function getResponse()
64
    {
65 1
        return $this->response;
66
    }
67
68
    /**
69
     * @param string $response
70
     */
71 2
    public function setResponse($response)
72
    {
73 2
        $this->response = $response;
74 2
    }
75
76
    /**
77
     * @return bool
78
     */
79
    public function isFailed()
80
    {
81
        return $this->failed;
82
    }
83
84
    /**
85
     * @param bool $failed
86
     */
87 1
    public function setFailed($failed)
88
    {
89 1
        $this->failed = $failed;
90 1
    }
91
}
92