<commit_before><?php
namespace Bolt\Controller\Backend;

use Bolt\Controller\Base;
use Bolt\Translation\Translator as Trans;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;

/**
 * Base class for all backend controllers.
 *
 * @author <NAME> <<EMAIL>>
 */
abstract class BackendBase extends Base
{
    public function connect(Application $app)
    {
        $c = parent::connect($app);
        $c->value('end', 'backend'); // For now

        $c->before(array($this, 'before'));

        return $c;
    }

    protected function render($template, array $variables = array(), array $globals = array())
    {
        if (!isset($variables['context'])) {
            $variables['context'] = $variables;
        }
        return parent::render($template, $variables, $globals);
    }

    /**
     * Middleware function to check whether a user is logged on.<commit_msg>Fix Backend template context shortcut<commit_after><?php
namespace Bolt\Controller\Backend;

use Bolt\Controller\Base;
use Bolt\Translation\Translator as Trans;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;

/**
 * Base class for all backend controllers.
 *
 * @author <NAME> <<EMAIL>>
 */
abstract class BackendBase extends Base
{
    public function connect(Application $app)
    {
        $c = parent::connect($app);
        $c->value('end', 'backend'); // For now

        $c->before(array($this, 'before'));

        return $c;
    }

    protected function render($template, array $variables = array(), array $globals = array())
    {
        if (!isset($variables['context'])) {
            $variables = array('context' => $variables);
        }
        return parent::render($template, $variables, $globals);
    }

    /**
     * Middleware function to check whether a user is logged on.
{'fraction_non_alphanumeric': 0.14182825484764544, 'fraction_numerical': 0.0, 'mean_word_length': 3.1138952164009113, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '5511235', 'n_tokens_mistral': 510, 'n_tokens_neox': 502, 'n_words': 140}