@@ -20,10 +20,10 @@ class Item implements \Suin\RSSWriter\ItemInterface
20
20
protected $ isPermalink ;
21
21
/** @var int */
22
22
protected $ pubDate ;
23
- /** @var array */
24
- protected $ enclosure ;
25
- /** @var string */
26
- protected $ author ;
23
+ /** @var array */
24
+ protected $ enclosure ;
25
+ /** @var string */
26
+ protected $ author ;
27
27
28
28
/**
29
29
* Set item title
@@ -95,10 +95,10 @@ public function pubDate($pubDate)
95
95
}
96
96
97
97
/**
98
- * Set enclosure
98
+ * Set enclosure
99
99
* @param var $url Url to media file
100
- * @param int $length Length in bytes of the media file
101
- * @param var $type Media type, default is audio/mpeg
100
+ * @param int $length Length in bytes of the media file
101
+ * @param var $type Media type, default is audio/mpeg
102
102
* @return $this
103
103
*/
104
104
public function enclosure ($ url , $ length = 0 , $ type = 'audio/mpeg ' )
@@ -118,7 +118,7 @@ public function author($author)
118
118
return $ this ;
119
119
}
120
120
121
- /**
121
+ /**
122
122
* Append item to the channel
123
123
* @param \Suin\RSSWriter\ChannelInterface $channel
124
124
* @return $this
@@ -135,7 +135,7 @@ public function appendTo(ChannelInterface $channel)
135
135
*/
136
136
public function asXML ()
137
137
{
138
- $ xml = new SimpleXMLElement ('<?xml version="1.0" encoding="UTF-8" ?><item></item> ' , LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL );
138
+ $ xml = new SimpleXMLElement ('<?xml version="1.0" encoding="UTF-8" ?><item></item> ' , LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL );
139
139
$ xml ->addChild ('title ' , $ this ->title );
140
140
$ xml ->addChild ('link ' , $ this ->url );
141
141
$ xml ->addChild ('description ' , $ this ->description );
@@ -165,17 +165,16 @@ public function asXML()
165
165
$ xml ->addChild ('pubDate ' , date (DATE_RSS , $ this ->pubDate ));
166
166
}
167
167
168
-
169
- if (is_array ($ this ->enclosure ) && (count ($ this ->enclosure ) == 3 ))
168
+ if (is_array ($ this ->enclosure ) && (count ($ this ->enclosure ) == 3 ))
170
169
{
171
170
$ element = $ xml ->addChild ('enclosure ' );
172
- $ element ->addAttribute ('url ' , $ this ->enclosure ['url ' ]);
173
- $ element ->addAttribute ('type ' , $ this ->enclosure ['type ' ]);
174
-
175
- if ($ this ->enclosure ['length ' ])
176
- {
177
- $ element ->addAttribute ('length ' , $ this ->enclosure ['length ' ]);
178
- }
171
+ $ element ->addAttribute ('url ' , $ this ->enclosure ['url ' ]);
172
+ $ element ->addAttribute ('type ' , $ this ->enclosure ['type ' ]);
173
+
174
+ if ($ this ->enclosure ['length ' ])
175
+ {
176
+ $ element ->addAttribute ('length ' , $ this ->enclosure ['length ' ]);
177
+ }
179
178
}
180
179
181
180
if ( ! empty ($ this ->author ) )
0 commit comments