<commit_before><?php

class SitemapXML_Controller extends Page_Controller {

    private static $url_handlers = array(
        '' => 'GetSitemapXML'
    );

    private static $allowed_actions = array(
        'GetSitemapXML'
    );

    public function init()
    {
        $this->response->addHeader("Content-Type", "application/xml");
        
        parent::init();

        $this->getSiteTree();
    }

    public function GetSitemapXML()
    {
        $sitemap = new ArrayData(array(
            'Pages' => $this->pages
        ));
        return $sitemap->renderWith('SitemapPages');
    }

    private function getSiteTree()
    {
        $this->pages = SiteTree::get()->filter(array(
            'ClassName:not' => 'ErrorPage'
        ));
    }
}<commit_msg>Move calls within Sitemap Xml controller<commit_after><?php

class SitemapXML_Controller extends Page_Controller {

    private static $url_handlers = array(
        '' => 'GetSitemapXML'
    );

    private static $allowed_actions = array(
        'GetSitemapXML'
    );

    public function init()
    {
        parent::init();
    }

    public function GetSitemapXML()
    {
        $this->response->addHeader("Content-Type", "application/xml");
        $this->getSiteTree();

        $sitemap = new ArrayData(array(
            'Pages' => $this->pages
        ));
        return $sitemap->renderWith('SitemapPages');
    }

    private function getSiteTree()
    {
        $this->pages = SiteTree::get()->filter(array(
            'ClassName:not' => 'ErrorPage'
        ));
    }
}
{'fraction_non_alphanumeric': 0.1377091377091377, 'fraction_numerical': 0.0, 'mean_word_length': 2.2736842105263158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4602473', 'n_tokens_mistral': 469, 'n_tokens_neox': 456, 'n_words': 83}