Completed
Push — master ( 65fdb2...7704a6 )
by Ed
02:47
created

SimplePieSetUp::loadConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
namespace ejdelmonico\LaravelRSSFeed\helpers;
4
5
use SimplePie;
6
7
/**
8
 * SimplePie SetUp.
9
 */
10
class SimplePieSetUp
11
{
12
    protected $feed;
13
14
    public function __construct()
15
    {
16
        $this->feed = new SimplePie();
17
    }
18
19
    /**
20
     * Load the config array.
21
     *
22
     * @param array $config
0 ignored issues
show
Bug introduced by
There is no parameter named $config. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
23
     *
24
     * @return \SimplePie
25
     */
26
    public function loadConfig()
27
    {
28
        $this->feed->set_cache_location(config('feed.cache.location'));
29
        $this->feed->set_cache_duration(config('cache.life'));
30
        $this->feed->enable_cache(config('cache.enabled'));
31
        $this->feed->set_item_limit(config('item_limit'));
32
        $this->feed->strip_htmltags(config('strip_htmltags.tags'));
33
        $this->feed->strip_attributes(config('strip_attributes.tags'));
34
        $this->feed->force_feed(config('force_feed.enabled'));
35
        $this->feed->enable_order_by_date(config('order_by_date.enabled'));
36
        $this->feed->strip_comments(config('strip_html_comments.enabled'));
37
38
        return $this->feed;
39
    }
40
41
    /**
42
     * Init SimplePie.
43
     */
44
    public function init()
45
    {
46
        $this->feed->init();
47
    }
48
49
    /**
50
     * Set the feed url.
51
     *
52
     * @param $url
53
     */
54
    public function setRSSFeedUrl($url)
55
    {
56
        $this->feed->set_feed_url($url);
57
    }
58
59
    /**
60
     * Wrapper for MIME-types.
61
     */
62
    public function handleContentType()
63
    {
64
        $this->feed->handle_content_type();
65
    }
66
}
67