@@ -9,7 +9,7 @@ |
||
| 9 | 9 | /** |
| 10 | 10 | * Add channel |
| 11 | 11 | * @param \Bhaktaraz\RSSGenerator\ChannelInterface $channel |
| 12 | - * @return $thisJ |
|
| 12 | + * @return Feed |
|
| 13 | 13 | */ |
| 14 | 14 | public function addChannel(ChannelInterface $channel); |
| 15 | 15 | |
@@ -4,5 +4,5 @@ |
||
| 4 | 4 | require_once 'Vendor/autoload.php'; |
| 5 | 5 | |
| 6 | 6 | // Load test target classes |
| 7 | -spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//').'.php'; }); |
|
| 8 | -set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__DIR__).'/Source'); |
|
| 9 | 7 | \ No newline at end of file |
| 8 | +spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//') . '.php'; }); |
|
| 9 | +set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__DIR__) . '/Source'); |
|
| 10 | 10 | \ No newline at end of file |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Load test target classes |
| 4 | -spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//').'.php'; }); |
|
| 5 | -set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/Source'); |
|
| 4 | +spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//') . '.php'; }); |
|
| 5 | +set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/Source'); |
|
| 6 | 6 | |
| 7 | 7 | use \Bhaktaraz\RSSGenerator\Feed; |
| 8 | 8 | use \Bhaktaraz\RSSGenerator\Channel; |
@@ -54,8 +54,8 @@ |
||
| 54 | 54 | /** |
| 55 | 55 | * Set enclosure |
| 56 | 56 | * @param var $url Url to media file |
| 57 | - * @param int $length Length in bytes of the media file |
|
| 58 | - * @param var $type Media type, default is audio/mpeg |
|
| 57 | + * @param int $length Length in bytes of the media file |
|
| 58 | + * @param var $type Media type, default is audio/mpeg |
|
| 59 | 59 | * @return $this |
| 60 | 60 | */ |
| 61 | 61 | public function enclosure($url, $length = 0, $type = 'audio/mpeg'); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | { |
| 7 | 7 | public function addChild($name, $value = null, $namespace = null) |
| 8 | 8 | { |
| 9 | - if ( $value !== null and is_string($value) === true ) |
|
| 9 | + if ($value !== null and is_string($value) === true) |
|
| 10 | 10 | { |
| 11 | 11 | $value = str_replace('&', '&', $value); |
| 12 | 12 | } |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | protected $isPermalink; |
| 21 | 21 | /** @var int */ |
| 22 | 22 | protected $pubDate; |
| 23 | - /** @var array */ |
|
| 24 | - protected $enclosure; |
|
| 23 | + /** @var array */ |
|
| 24 | + protected $enclosure; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Set item title |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * Set enclosure |
| 97 | 97 | * @param var $url Url to media file |
| 98 | - * @param int $length Length in bytes of the media file |
|
| 99 | - * @param var $type Media type, default is audio/mpeg |
|
| 98 | + * @param int $length Length in bytes of the media file |
|
| 99 | + * @param var $type Media type, default is audio/mpeg |
|
| 100 | 100 | * @return $this |
| 101 | 101 | */ |
| 102 | 102 | public function enclosure($url, $length = 0, $type = 'audio/mpeg') |
@@ -153,16 +153,16 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | - if (is_array($this->enclosure) && (count($this->enclosure) == 3)) |
|
| 156 | + if (is_array($this->enclosure) && (count($this->enclosure) == 3)) |
|
| 157 | 157 | { |
| 158 | 158 | $element = $xml->addChild('enclosure'); |
| 159 | - $element->addAttribute('url', $this->enclosure['url']); |
|
| 160 | - $element->addAttribute('type', $this->enclosure['type']); |
|
| 159 | + $element->addAttribute('url', $this->enclosure['url']); |
|
| 160 | + $element->addAttribute('type', $this->enclosure['type']); |
|
| 161 | 161 | |
| 162 | - if ($this->enclosure['length']) |
|
| 163 | - { |
|
| 164 | - $element->addAttribute('length', $this->enclosure['length']); |
|
| 165 | - } |
|
| 162 | + if ($this->enclosure['length']) |
|
| 163 | + { |
|
| 164 | + $element->addAttribute('length', $this->enclosure['length']); |
|
| 165 | + } |
|
| 166 | 166 | } |
| 167 | 167 | return $xml; |
| 168 | 168 | } |
@@ -127,27 +127,27 @@ |
||
| 127 | 127 | $xml->addChild('link', $this->url); |
| 128 | 128 | $xml->addChild('description', $this->description); |
| 129 | 129 | |
| 130 | - foreach ( $this->categories as $category ) |
|
| 130 | + foreach ($this->categories as $category) |
|
| 131 | 131 | { |
| 132 | 132 | $element = $xml->addChild('category', $category[0]); |
| 133 | 133 | |
| 134 | - if ( isset($category[1]) ) |
|
| 134 | + if (isset($category[1])) |
|
| 135 | 135 | { |
| 136 | 136 | $element->addAttribute('domain', $category[1]); |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if ( $this->guid ) |
|
| 140 | + if ($this->guid) |
|
| 141 | 141 | { |
| 142 | 142 | $guid = $xml->addChild('guid', $this->guid); |
| 143 | 143 | |
| 144 | - if ( $this->isPermalink ) |
|
| 144 | + if ($this->isPermalink) |
|
| 145 | 145 | { |
| 146 | 146 | $guid->addAttribute('isPermaLink', 'true'); |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if ( $this->pubDate !== null ) |
|
| 150 | + if ($this->pubDate !== null) |
|
| 151 | 151 | { |
| 152 | 152 | $xml->addChild('pubDate', date(DATE_RSS, $this->pubDate)); |
| 153 | 153 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" />', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL); |
| 32 | 32 | |
| 33 | - foreach ( $this->channels as $channel ) |
|
| 33 | + foreach ($this->channels as $channel) |
|
| 34 | 34 | { |
| 35 | 35 | $toDom = dom_import_simplexml($xml); |
| 36 | 36 | $fromDom = dom_import_simplexml($channel->asXML()); |
@@ -152,32 +152,32 @@ |
||
| 152 | 152 | $xml->addChild('link', $this->url); |
| 153 | 153 | $xml->addChild('description', $this->description); |
| 154 | 154 | |
| 155 | - if ( $this->language !== null ) |
|
| 155 | + if ($this->language !== null) |
|
| 156 | 156 | { |
| 157 | 157 | $xml->addChild('language', $this->language); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if ( $this->copyright !== null ) |
|
| 160 | + if ($this->copyright !== null) |
|
| 161 | 161 | { |
| 162 | 162 | $xml->addChild('copyright', $this->copyright); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if ( $this->pubDate !== null ) |
|
| 165 | + if ($this->pubDate !== null) |
|
| 166 | 166 | { |
| 167 | 167 | $xml->addChild('pubDate', date(DATE_RSS, $this->pubDate)); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - if ( $this->lastBuildDate !== null ) |
|
| 170 | + if ($this->lastBuildDate !== null) |
|
| 171 | 171 | { |
| 172 | 172 | $xml->addChild('lastBuildDate', date(DATE_RSS, $this->lastBuildDate)); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - if ( $this->ttl !== null ) |
|
| 175 | + if ($this->ttl !== null) |
|
| 176 | 176 | { |
| 177 | 177 | $xml->addChild('ttl', $this->ttl); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - foreach ( $this->items as $item ) |
|
| 180 | + foreach ($this->items as $item) |
|
| 181 | 181 | { |
| 182 | 182 | $toDom = dom_import_simplexml($xml); |
| 183 | 183 | $fromDom = dom_import_simplexml($item->asXML()); |