Completed
Push — master ( 0faaf3...ff80f9 )
by Fabien
04:33
created

Profile   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 86
ccs 18
cts 20
cp 0.9
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlugin() 0 4 1
A getRequest() 0 4 1
A __construct() 0 4 1
A setRequest() 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
     */
37 5
    public function __construct($plugin)
38
    {
39 5
        $this->plugin = $plugin;
40 5
    }
41
42
    /**
43
     * @return string
44
     */
45 1
    public function getPlugin()
46
    {
47 1
        return $this->plugin;
48
    }
49
50
    /**
51
     * @return string
52
     */
53 1
    public function getRequest()
54
    {
55 1
        return $this->request;
56
    }
57
58
    /**
59
     * @param string $request
60
     */
61 5
    public function setRequest($request)
62
    {
63 5
        $this->request = $request;
64 5
    }
65
66
    /**
67
     * @return string
68
     */
69 1
    public function getResponse()
70
    {
71 1
        return $this->response;
72
    }
73
74
    /**
75
     * @param string $response
76
     */
77 2
    public function setResponse($response)
78
    {
79 2
        $this->response = $response;
80 2
    }
81
82
    /**
83
     * @return bool
84
     */
85
    public function isFailed()
86
    {
87
        return $this->failed;
88
    }
89
90
    /**
91
     * @param bool $failed
92
     */
93 1
    public function setFailed($failed)
94
    {
95 1
        $this->failed = $failed;
96 1
    }
97
}
98