Profile   A
last analyzed

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 __construct() 0 4 1
A getPlugin() 0 4 1
A getRequest() 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
declare(strict_types=1);
4
5
namespace Http\HttplugBundle\Collector;
6
7
/**
8
 * A Profile holds representation of what goes in an plugin (request) and what goes out (response and failure state).
9
 *
10
 * @author Fabien Bourigault <[email protected]>
11
 *
12
 * @internal
13
 */
14
final class Profile
15
{
16
    /**
17
     * @var string
18
     */
19
    private $plugin;
20
21
    /**
22
     * @var string
23
     */
24
    private $request;
25
26
    /**
27
     * @var string
28
     */
29
    private $response;
30
31
    /**
32
     * @var bool
33
     */
34
    private $failed = false;
35
36
    /**
37
     * @param string $plugin
38
     */
39 9
    public function __construct($plugin)
40
    {
41 9
        $this->plugin = $plugin;
42 9
    }
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
     * @param string $request
62
     */
63 8
    public function setRequest($request)
64
    {
65 8
        $this->request = $request;
66 8
    }
67
68
    /**
69
     * @return string
70
     */
71 1
    public function getResponse()
72
    {
73 1
        return $this->response;
74
    }
75
76
    /**
77
     * @param string $response
78
     */
79 9
    public function setResponse($response)
80
    {
81 9
        $this->response = $response;
82 9
    }
83
84
    /**
85
     * @return bool
86
     */
87
    public function isFailed()
88
    {
89
        return $this->failed;
90
    }
91
92
    /**
93
     * @param bool $failed
94
     */
95 2
    public function setFailed($failed)
96
    {
97 2
        $this->failed = $failed;
98 2
    }
99
}
100