PicoFeedClientFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A build() 0 5 1
1
<?php
2
/**
3
 * ownCloud - News
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Alessandro Cosentino <[email protected]>
9
 * @author Bernhard Posselt <[email protected]>
10
 * @copyright Alessandro Cosentino 2012
11
 * @copyright Bernhard Posselt 2012, 2014
12
 */
13
14
15
namespace OCA\News\Utility;
16
17
use \PicoFeed\Config\Config;
18
use \PicoFeed\Client\Client;
19
20
class PicoFeedClientFactory {
21
22
    private $config;
23
24
    public function __construct(Config $config) {
25
        $this->config = $config;
26
    }
27
28
29
    /**
30
     * Returns a new instance of an PicoFeed Http client
31
     * @return \PicoFeed\Client instance
32
     */
33
    public function build() {
34
        $client = Client::getInstance();
35
        $client->setConfig($this->config);
36
        return $client;
37
    }
38
39
40
}