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

Response::isModified()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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