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

Response   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 64
ccs 12
cts 14
cp 0.8571
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isModified() 0 4 1
A getBody() 0 4 1
A getHeaders() 0 4 1
A getHeader() 0 4 1
A getLastModified() 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\FileSystem;
12
13
use FeedIo\Adapter\ResponseInterface;
14
15
/**
16
 *
17
 */
18
class Response implements ResponseInterface
19
{
20
21
    /**
22
     * @var string
23
     */
24
    protected $fileContent;
25
26
    /**
27
     * @var \DateTime
28
     */
29
    protected $lastModified;
30
31
    /**
32
     * @param string    $fileContent
33
     * @param \DateTime $lastModified
34
     */
35 1
    public function __construct($fileContent, \DateTime $lastModified)
36
    {
37 1
        $this->fileContent  = $fileContent;
38 1
        $this->lastModified = $lastModified;
39 1
    }
40
41
    /**
42
    * @return boolean
43
    */
44
    public function isModified()
45
    {
46
        return true;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function getBody()
53
    {
54 1
        return $this->fileContent;
55
    }
56
57
    /**
58
     * @return array
59
     */
60 1
    public function getHeaders()
61
    {
62 1
        return array();
63
    }
64
65
    /**
66
     * @param  string $name
67
     * @return string
68
     */
69 1
    public function getHeader($name)
70
    {
71 1
        return '';
72
    }
73
74
    /**
75
     * @return \DateTime
76
     */
77 1
    public function getLastModified()
78
    {
79 1
        return $this->lastModified;
80
    }
81
}
82