<commit_before><?php
/*
 * Copyright 2015 <NAME> <http://jacksleight.com/>
 * This source file is subject to the MIT license that is bundled with this package in the file LICENCE. 
 */

namespace Coast;

use Coast\Xml;

class Feed
{
    protected $_xml;

    public function __construct($title, \Coast\Url $link, $author, \DateTime $updated)
    {
        $this->_xml = new Xml('<?xml version="1.0" encoding="UTF-8"?><feed/>');
        $this->_xml->addAttribute('xmlns', 'http://www.w3.org/2005/Atom');

        $this->_xml->addChild('title', $title);
        $this->_xml->addChild('id', (string) $link);
        $this->_xml->addChild('link')->addAttribute('href', $link);
        $this->_xml->addChild('author')->addChild('name', $author);
        $this->_xml->addChild('updated', $updated->format(\DateTime::W3C));
    }

    public function add($title, \Coast\Url $link, \DateTime $updated, $summary = null, $content = null)
    {
        $entry = $this->_xml->addChild('entry');
        $entry->addChild('id', (string) $link);
        $entry->addChild('title')->addCData($title);
        $entry->addChild('link')->addAttribute('href', $link);
        $entry->addChild('updated', $updated->format(\DateTime::W3C));
        if (isset($summary)) {
            $entry->addChild('summary')->addCData($summary);
        }
        if (isset($content)) {
            $entry->addChild('content')->addCData($content);
        }
    }

    public function toXml()
    {
        return $this->_xml;
    }
}<commit_msg>Add html type attribute to feed content<commit_after><?php
/*
 * Copyright 2015 <NAME> <http://jacksleight.com/>
 * This source file is subject to the MIT license that is bundled with this package in the file LICENCE. 
 */

namespace Coast;

use Coast\Xml;

class Feed
{
    protected $_xml;

    public function __construct($title, \Coast\Url $link, $author, \DateTime $updated)
    {
        $this->_xml = new Xml('<?xml version="1.0" encoding="UTF-8"?><feed/>');
        $this->_xml->addAttribute('xmlns', 'http://www.w3.org/2005/Atom');

        $this->_xml->addChild('title', $title);
        $this->_xml->addChild('id', (string) $link);
        $this->_xml->addChild('link')->addAttribute('href', $link);
        $this->_xml->addChild('author')->addChild('name', $author);
        $this->_xml->addChild('updated', $updated->format(\DateTime::W3C));
    }

    public function add($title, \Coast\Url $link, \DateTime $updated, $summary = null, $content = null)
    {
        $entry = $this->_xml->addChild('entry');
        $entry->addChild('id', (string) $link);
        $entry->addChild('title')->addCData($title);
        $entry->addChild('link')->addAttribute('href', $link);
        $entry->addChild('updated', $updated->format(\DateTime::W3C));
        if (isset($summary)) {
            $entry->addChild('summary')->addCData($summary)->addAttribute('type', 'html');
        }
        if (isset($content)) {
            $entry->addChild('content')->addCData($content)->addAttribute('type', 'html');
        }
    }

    public function toXml()
    {
        return $this->_xml;
    }
}
{'fraction_non_alphanumeric': 0.20090148100450742, 'fraction_numerical': 0.00901481004507405, 'mean_word_length': 3.082785808147175, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 2, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1913786', 'n_tokens_mistral': 979, 'n_tokens_neox': 949, 'n_words': 188}