File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ declare (strict_types = 1 );
3
+
4
+ namespace Forensic \FeedParser \FeedItems ;
5
+
6
+ use Forensic \FeedParser \Enums \FeedItemTypes ;
7
+ use Forensic \FeedParser \XPath ;
8
+ use DOMElement ;
9
+
10
+ class RSSFeedItem extends BaseFeedItem
11
+ {
12
+ public function __construct (DOMElement $ item , XPath $ xpath ,
13
+ bool $ remove_styles , bool $ remove_scripts )
14
+ {
15
+ $ property_selectors = [
16
+ 'id ' => 'guid ' ,
17
+ 'title ' => 'title ' ,
18
+ 'link ' => 'link ' ,
19
+ 'content ' => 'content:encoded || description ' ,
20
+ 'source ' => 'source ' ,
21
+ 'enclosure ' => [
22
+ 'type ' => 'enclosure/@type ' ,
23
+ 'url ' => 'enclosure/@url ' ,
24
+ 'length ' => 'enclosure/@length '
25
+ ],
26
+ //'image' => { 'src' => '', 'link' => '', 'title' => '' }, // to be parsed specially
27
+ 'lastUpdated ' => 'pubDate ' ,
28
+ 'author ' => 'author || dc:creator ' ,
29
+ 'category ' => 'category '
30
+ ];
31
+
32
+ parent ::__construct (
33
+ new FeedItemTypes (FeedItemTypes::RSS_FEED_ITEM ),
34
+ $ item ,
35
+ $ xpath ,
36
+ $ property_selectors ,
37
+ $ remove_styles ,
38
+ $ remove_scripts
39
+ );
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments