Completed
Push — master ( 471a2c...9baf90 )
by Alex
14s
created

Request   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 61
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getUrl() 0 4 1
A getModifiedSince() 0 4 1
A getResponse() 0 4 1
A setResponse() 0 4 1
1
<?php declare(strict_types=1);
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\Async;
12
13
use FeedIo\Adapter\ResponseInterface;
14
15
class Request
16
{
17
18
    /**
19
     * @var string
20
     */
21
    protected $url;
22
23
    /**
24
     * @var \DateTime
25
     */
26
    protected $modifiedSince;
27
28
    /**
29
     * @var \FeedIo\Adapter\ResponseInterface
30
     */
31
    protected $response;
32
33
    /**
34
     * Request constructor.
35
     * @param $url
36
     * @param $modifiedSince
37
     */
38 4
    public function __construct(string $url, \DateTime $modifiedSince = null)
39
    {
40 4
        $this->url = $url;
41 4
        $this->modifiedSince = $modifiedSince ?? new \DateTime('@0');
42 4
    }
43
44
    /**
45
     * @return string
46
     */
47 4
    public function getUrl(): string
48
    {
49 4
        return $this->url;
50
    }
51
52
    /**
53
     * @return \DateTime
54
     */
55 3
    public function getModifiedSince(): \DateTime
56
    {
57 3
        return $this->modifiedSince;
58
    }
59
60
    /**
61
     * @return ResponseInterface
62
     */
63 2
    public function getResponse(): ResponseInterface
64
    {
65 2
        return $this->response;
66
    }
67
68
    /**
69
     * @param ResponseInterface $response
70
     */
71 2
    public function setResponse(ResponseInterface $response)
72
    {
73 2
        $this->response = $response;
74 2
    }
75
}
76