<commit_before><?php

declare(strict_types=1);

/*
 * This file is part of the SkeletonDancer package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace SkeletonDancer\Service;

use SkeletonDancer\Dance;
use SkeletonDancer\StringUtil;
use Symfony\Component\Yaml\Yaml;

class TwigTemplating
{
    public function create(Dance $dance): \Twig_Environment
    {
        $loader = new \Twig_Loader_Filesystem(__DIR__.'/../../templates');
        $loader->addPath($dance->directory.'/templates');

        $twig = new \Twig_Environment(
            $loader,
            [
                'debug' => true,
                'cache' => new \Twig_Cache_Filesystem(sys_get_temp_dir().'/twig'),
                'strict_variables' => true,
            ]
        );
<commit_msg>Allow templates to be overwritten<commit_after><?php

declare(strict_types=1);

/*
 * This file is part of the SkeletonDancer package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace SkeletonDancer\Service;

use SkeletonDancer\Dance;
use SkeletonDancer\StringUtil;
use Symfony\Component\Yaml\Yaml;

class TwigTemplating
{
    public function create(Dance $dance): \Twig_Environment
    {
        $loader = new \Twig_Loader_Filesystem(__DIR__.'/../../templates');
        $loader->prependPath($dance->directory.'/templates');

        $twig = new \Twig_Environment(
            $loader,
            [
                'debug' => true,
                'cache' => new \Twig_Cache_Filesystem(sys_get_temp_dir().'/twig'),
                'strict_variables' => true,
            ]
        );

{'fraction_non_alphanumeric': 0.1235827664399093, 'fraction_numerical': 0.0011337868480725624, 'mean_word_length': 2.551307847082495, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '7366845', 'n_tokens_mistral': 559, 'n_tokens_neox': 542, 'n_words': 130}