Completed
Push — master ( 7e0ba3...cda426 )
by Ed
03:46
created

FeedFactory::makeRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace ejdelmonico\LaravelRSSFeed;
4
5
use ejdelmonico\LaravelRSSFeed\helpers\SimplePieSetUp;
6
7
class FeedFactory
8
{
9
    protected $config;
10
    protected $feeder;
11
12
    /**
13
     * Create a new Feed Instance.
14
     */
15
    public function __construct($config)
16
    {
17
        $this->config = $config;
18
    }
19
20
    /**
21
     * @param $url
22
     *
23
     * @return \ejdelmonico\LaravelRSSFeed\helpers\SimplePieSetUp
24
     */
25
    public function makeRequest($url)
26
    {
27
        $this->feeder = new SimplePieSetUp();
28
        $this->feeder->loadConfig($this->config);
29
        $this->feeder->setRSSFeedUrl($url);
30
        $this->feeder->init();
31
        $this->feeder->handleContentType();
32
33
        return $this->feeder;
34
    }
35
}
36