<?php

namespace Clue\Confgen;

use Twig_Loader_String;
use Twig_Environment;
use JsonSchema\Validator;

class Factory
{
    public function createConfgen()
    {
        // documentation explicitly warns against using this loader because it
        // will be removed with Twig v2.0 eventually.
        // However, it exactly implements our use case because template contents
        // are always held in memory.
        $loader = new Twig_Loader_String();

        $twig = new Twig_Environment($loader);
        $twig->enableStrictVariables();

        $validator = new Validator();

        return new Confgen($twig, $validator);
    }
}

<?php

namespace Clue\Confgen;

use Twig_Environment;
use JsonSchema\Validator;

class Factory
{
    public function createConfgen()
    {
        $twig = new Twig_Environment();
        $twig->enableStrictVariables();

        $validator = new Validator();

        return new Confgen($twig, $validator);
    }
}

Remove useless Twig_Loader_String (overloaded via Confgen anyway)
Remove useless Twig_Loader_String (overloaded via Confgen anyway)