<commit_before><?php
class CSVReport extends Report
{
    public function __construct()
    {
        //parent::__construct();
    }

    public function output()
    {
        header("Content-Type: text/csv");
        header('Content-Disposition: attachment; filename="report.csv"');
        header('Content-Transfer-Encoding: binary');

        foreach($this->contents as $content)
        {
            switch($content->getType())
            {
            case "table":
                //$pdf->table($content->getHeaders(),$content->getData());
                print '"'.implode('","',$content->getHeaders()).'"'."\n";
                foreach($content->getData() as $data)
                {
                    print '"'.implode('","',$data).'"'."\n";
                }
                break;
            }
        }
        die();
    }
}<commit_msg>Fixed a bug with the CSV reporting engine<commit_after><?php
class CSVReport extends Report
{
    public function __construct()
    {
        //parent::__construct();
    }

    public function output($file = null)
    {
        header("Content-Type: text/csv");
        header('Content-Disposition: attachment; filename="report.csv"');
        header('Content-Transfer-Encoding: binary');

        foreach($this->contents as $content)
        {
            switch($content->getType())
            {
            case "table":
                //$pdf->table($content->getHeaders(),$content->getData());
                print '"'.implode('","',$content->getHeaders()).'"'."\n";
                foreach($content->getData() as $data)
                {
                    print '"'.implode('","',$data).'"'."\n";
                }
                break;
            }
        }
        die();
    }
}
{'fraction_non_alphanumeric': 0.1737142857142857, 'fraction_numerical': 0.0, 'mean_word_length': 1.653030303030303, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3054032', 'n_tokens_mistral': 465, 'n_tokens_neox': 446, 'n_words': 78}