<commit_before><?php

namespace ZfcTwig\Service;

use ZfcTwig\View\Renderer;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Resolver\TemplatePathStack;

class ViewRendererFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Configuration');
        $config = $config['zfctwig'];

        $pathResolver = $serviceLocator->get('ViewTemplatePathStack');
        $pathResolver->setDefaultSuffix($config['suffix']);
        $resolver = $serviceLocator->get('ViewResolver');

        $renderer = new Renderer();
        $renderer->setEngine($serviceLocator->get('TwigEnvironment'));
        $renderer->setResolver($resolver);

        return $renderer;
    }
}
<commit_msg>Set the Renderer in the View Helper Manager<commit_after><?php

namespace ZfcTwig\Service;

use ZfcTwig\View\Renderer;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Resolver\TemplatePathStack;

class ViewRendererFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Configuration');
        $config = $config['zfctwig'];

        $pathResolver = $serviceLocator->get('ViewTemplatePathStack');
        $pathResolver->setDefaultSuffix($config['suffix']);
        $resolver = $serviceLocator->get('ViewResolver');

        $renderer = new Renderer();

        $engine = $serviceLocator->get('TwigEnvironment');
        $engine->manager()->setRenderer($renderer);

        $renderer->setEngine($engine);
        $renderer->setResolver($resolver);

        return $renderer;
    }
}

{'fraction_non_alphanumeric': 0.12464749012972363, 'fraction_numerical': 0.0, 'mean_word_length': 4.311377245508982, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6260987', 'n_tokens_mistral': 488, 'n_tokens_neox': 482, 'n_words': 80}