Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 17 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
FeaturedFeedItem | |
0.00% |
0 / 17 |
|
0.00% |
0 / 7 |
56 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
fromArray | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
getRawDate | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getRawTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getRawUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getRawText | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
toArray | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\FeaturedFeeds; |
4 | |
5 | use MediaWiki\Feed\FeedItem; |
6 | |
7 | class FeaturedFeedItem extends FeedItem { |
8 | public function __construct( string $title, string $url, string $text, string $date ) { |
9 | parent::__construct( $title, $text, $url, $date ); |
10 | } |
11 | |
12 | public static function fromArray( array $array ) { |
13 | return new FeaturedFeedItem( |
14 | $array['title'], |
15 | $array['url'], |
16 | $array['text'], |
17 | $array['date'] |
18 | ); |
19 | } |
20 | |
21 | public function getRawDate() { |
22 | return $this->date; |
23 | } |
24 | |
25 | public function getRawTitle() { |
26 | return $this->title; |
27 | } |
28 | |
29 | public function getRawUrl() { |
30 | return $this->url; |
31 | } |
32 | |
33 | public function getRawText() { |
34 | return $this->description; |
35 | } |
36 | |
37 | public function toArray() { |
38 | return [ |
39 | 'title' => $this->title, |
40 | 'url' => $this->url, |
41 | 'text' => $this->description, |
42 | 'date' => $this->date, |
43 | ]; |
44 | } |
45 | } |