BlogOptions::setFeed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Acelaya\Website\Feed;
5
6
use Zend\Stdlib\AbstractOptions;
7
8
class BlogOptions extends AbstractOptions
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $url = '';
14
    /**
15
     * @var string
16
     */
17
    protected $feed = '';
18
    /**
19
     * @var int
20
     */
21
    protected $elementsToDisplay = 5;
22
23
    /**
24
     * @return string
25
     */
26
    public function getUrl(): string
27
    {
28
        return $this->url;
29
    }
30
31
    /**
32
     * @param string $url
33
     * @return $this
34
     */
35
    public function setUrl(string $url)
36
    {
37
        $this->url = $url;
38
        return $this;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getFeed(): string
45
    {
46
        return $this->feed;
47
    }
48
49
    /**
50
     * @param string $feed
51
     * @return $this
52
     */
53
    public function setFeed(string $feed)
54
    {
55
        $this->feed = $feed;
56
        return $this;
57
    }
58
59
    /**
60
     * @return int
61
     */
62
    public function getElementsToDisplay(): int
63
    {
64
        return $this->elementsToDisplay;
65
    }
66
67
    /**
68
     * @param int $elementsToDisplay
69
     * @return $this
70
     */
71
    public function setElementsToDisplay(int $elementsToDisplay)
72
    {
73
        $this->elementsToDisplay = $elementsToDisplay;
74
        return $this;
75
    }
76
77
    public function getCacheKey(): string
78
    {
79
        return sprintf('blog_feed_%s', $this->url);
80
    }
81
}
82