HistoryEntry   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 53
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRequest() 0 4 1
A getResponse() 0 4 1
A __toString() 0 9 1
1
<?php
2
3
namespace Saxulum\HttpClient;
4
5
class HistoryEntry
6
{
7
    /**
8
     * @var Request
9
     */
10
    protected $request;
11
12
    /**
13
     * @var Response
14
     */
15
    protected $response;
16
17
    const SEPERATOR = "\n-----\n";
18
19
    /**
20
     * @param Request  $request
21
     * @param Response $response
22
     */
23
    public function __construct(Request $request, Response $response)
24
    {
25
        $this->request = $request;
26
        $this->response = $response;
27
    }
28
29
    /**
30
     * @return Request
31
     */
32
    public function getRequest()
33
    {
34
        return $this->request;
35
    }
36
37
    /**
38
     * @return Response
39
     */
40
    public function getResponse()
41
    {
42
        return $this->response;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function __toString()
49
    {
50
        $string = '';
51
        $string .= trim((string) $this->request);
52
        $string .= self::SEPERATOR;
53
        $string .= trim((string) $this->response);
54
55
        return $string;
56
    }
57
}
58