Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
7 / 7 |
RSSContentAggregator | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
7 / 7 |
process(DOMElement $node, Item $item) | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
setContent(DOMElement $node, Item $item) | |
100.00% |
1 / 1 |
2 | |
100.00% |
5 / 5 |
<?php | |
/** | |
* This file is part of the FastFeed package. | |
* | |
* (c) Daniel González <daniel@desarrolla2.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace FastFeed\Aggregator; | |
use DOMElement; | |
use FastFeed\Item; | |
/** | |
* RSSContentAggregator | |
* | |
* This Aggregator seem for a content:encoded field in item node and set as description | |
*/ | |
class RSSContentAggregator extends AbstractAggregator implements AggregatorInterface | |
{ | |
/** | |
* Execute the Aggregator | |
* | |
* @param DOMElement $node | |
* @param Item $item | |
*/ | |
public function process(DOMElement $node, Item $item) | |
{ | |
$this->setContent($node, $item); | |
} | |
/** | |
* | |
* @param DOMElement $node | |
* @param Item $item | |
*/ | |
protected function setContent(DOMElement $node, Item $item) | |
{ | |
$value = $this->getNodeValueByTagNameNS($node, 'http://purl.org/rss/1.0/modules/content/', 'encoded'); | |
if ($value) { | |
$item->setContent($value); | |
} | |
} | |
} |