MultiLineResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 83.33%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 56
ccs 10
cts 12
cp 0.8333
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMessage() 0 4 1
A getStatusCode() 0 4 1
A __toString() 0 4 1
A getLines() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the NNTP library.
5
 *
6
 * (c) Robin van der Vleuten <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Rvdv\Nntp\Response;
13
14
/**
15
 * MultiLineResponse.
16
 *
17
 * @author Robin van der Vleuten <[email protected]>
18
 */
19
class MultiLineResponse implements MultiLineResponseInterface
20
{
21
    /**
22
     * @var array
23
     */
24
    private $lines;
25
26
    /**
27
     * @var ResponseInterface
28
     */
29
    private $response;
30
31
    /**
32
     * Constructor.
33
     *
34
     * @param ResponseInterface $response
35
     * @param array             $lines
36
     */
37 2
    public function __construct(ResponseInterface $response, array $lines)
38
    {
39 2
        $this->response = $response;
40 2
        $this->lines = $lines;
41 2
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 1
    public function getMessage()
47
    {
48 1
        return $this->response->getMessage();
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 1
    public function getStatusCode()
55
    {
56 1
        return $this->response->getStatusCode();
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function getLines()
63
    {
64
        return $this->lines;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70 1
    public function __toString()
71
    {
72 1
        return (string) $this->response;
73
    }
74
}
75