Completed
Push — issue/109 ( 45613d )
by Alex
02:06
created

NullResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 44
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getBody() 0 4 1
A isModified() 0 4 1
A getLastModified() 0 4 1
A getHeaders() 0 4 1
A getHeader() 0 4 1
1
<?php
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Adapter;
12
13
/**
14
 * Null HTTP Response
15
 */
16
class NullResponse implements ResponseInterface
17
{
18
19
    /**
20
     * @return string
21
     */
22 1
    public function getBody()
23
    {
24 1
        return;
25
    }
26
27
    /**
28
    * @return boolean
29
    */
30
    public function isModified()
31
    {
32
        return true;
33
    }
34
35
    /**
36
     * @return \DateTime
37
     */
38 1
    public function getLastModified()
39
    {
40 1
        return new \DateTime('@0');
41
    }
42
43
    /**
44
     * @return array
45
     */
46 1
    public function getHeaders()
47
    {
48 1
        return array();
49
    }
50
51
    /**
52
     * @param  string       $name
53
     * @return array|string
54
     */
55 1
    public function getHeader($name)
56
    {
57 1
        return $name;
58
    }
59
}
60