Passed
Push — master ( 87765c...1be3e4 )
by Borislav
04:11
created

LiternewsFeed::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php namespace App\Feed;
2
3
class LiternewsFeed {
4
5
	const LATEST_LIMIT = 3;
6
7
	private $feedUrl;
8
9
	public function __construct(string $feedUrl) {
10
		$this->feedUrl = $feedUrl;
11
	}
12
13
	public function fetchLatest(int $limit = self::LATEST_LIMIT) {
14
		$fetcher = new FeedFetcher();
15
		$response = $fetcher->fetchAndTransform($this->feedUrl);
16
		return $response->limitArticles($limit)->cleanup();
17
	}
18
}
19