<commit_before><?php
/**
 * Created by PhpStorm.
 * User: jgabler
 * Date: 7/8/15
 * Time: 11:39 PM
 */

namespace Ucsf\LdapOrmBundle\Components;


class TwigString implements \Twig_LoaderInterface{
    public function getSource($name)
    {
        // get from database
        return $name;
    }

    public function isFresh($name, $time)
    {
        // determine from database
        return true;
    }

    public function getCacheKey($name)
    {
        // check if exists
        return 'twigStringService:' . $name;
    }

    public function render($string, $variables) {
//        error_log('STRING: '.$string);
//        error_log('VARIABLES: '.print_r($variables, TRUE));
        $twig = new \Twig_Environment($this);
        $rendered = $twig->render($string, $variables);
//        error_log('RENDERED: '.$rendered);
        return $rendered;
    }
}<commit_msg>cleaning up some comments in twig string renderer<commit_after><?php
/**
 * Created by PhpStorm.
 * User: jgabler
 * Date: 7/8/15
 * Time: 11:39 PM
 */

namespace Ucsf\LdapOrmBundle\Components;


class TwigString implements \Twig_LoaderInterface{
    public function getSource($name)
    {
        // get from database
        return $name;
    }

    public function isFresh($name, $time)
    {
        // determine from database
        return true;
    }

    public function getCacheKey($name)
    {
        // check if exists
        return 'twigStringService:' . $name;
    }

    public function render($string, $variables) {
        $twig = new \Twig_Environment($this);
        $rendered = $twig->render($string, $variables);
        return $rendered;
    }
}
{'fraction_non_alphanumeric': 0.12439320388349515, 'fraction_numerical': 0.009708737864077669, 'mean_word_length': 2.3930041152263373, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5491766', 'n_tokens_mistral': 528, 'n_tokens_neox': 505, 'n_words': 124}