<commit_before><?php
namespace Barebone;

use Slim\Container as ContainerInterface;

/**
 * Class Controller
 *
 * @package Barebone
 * @property \Aura\Session\Segment $session
 * @property \Noodlehaus\Config $config
 */
class Controller
{
    use LogTrait;

    /**
     * @var \Slim\Http\Environment
     */
    protected $env;

    /**
     * @var \Slim\Http\Request
     */
    protected $request;

    /**
     * @var \Slim\Http\Response
     */
    protected $response;

    /**
     * Controller constructor.
     *
     * @param ContainerInterface $ci
     */
    public function __construct(ContainerInterface $ci)
    {
        $this->request = $ci->get('request');
        $this->response = $ci->get('response');
        $this->env = $ci->get('environment');
    }

    /**
     * Render a view template with optional data
     *
     * @param $template
     * @param $data (optional)
     *
     * @return \Slim\Http\Response
     */
    protected function render($template, $data = [])
    {
        return $this->getResponse()->write(View::render($template, $data));
    }

    /**
     * Render data variable as application/json string
     *
     * @param array|object $data
     * @param int|null     $status The redirect HTTP status code.
     *
     * @return \Slim\Http\Response
     */
    protected function renderJSON($data = [], $status = null)
    {
        return $this->getResponse()->withJson($data, $status, JSON_PRETTY_PRINT);
    }


    /**
     * Redirect to URL with optional status
     *
     * @param string|UriInterface $url    The redirect destination.
     * @param int|null            $status The redirect HTTP status code.
     *
     * @return \Slim\Http\Response
     */
    protected function redirect($url, $status = null)
    {
        return $this->getResponse()->withRedirect($url, $status);
    }

    /**
     * Catch certain undefined properties and deliver something useful.
     *
     * @param $name
     * @return mixed
     */
    function __get($name)
    {
        if (strtolower($name) === 'session') {
            return Session::instance();
        }

        if (strtolower($name) === 'config') {
            return Config::instance();
        }

        return null;
    }
<commit_msg>respond to lowercase only<commit_after><?php
namespace Barebone;

use Slim\Container as ContainerInterface;

/**
 * Class Controller
 *
 * @package Barebone
 * @property \Aura\Session\Segment $session
 * @property \Noodlehaus\Config $config
 */
class Controller
{
    use LogTrait;

    /**
     * @var \Slim\Http\Environment
     */
    protected $env;

    /**
     * @var \Slim\Http\Request
     */
    protected $request;

    /**
     * @var \Slim\Http\Response
     */
    protected $response;

    /**
     * Controller constructor.
     *
     * @param ContainerInterface $ci
     */
    public function __construct(ContainerInterface $ci)
    {
        $this->request = $ci->get('request');
        $this->response = $ci->get('response');
        $this->env = $ci->get('environment');
    }

    /**
     * Render a view template with optional data
     *
     * @param $template
     * @param $data (optional)
     *
     * @return \Slim\Http\Response
     */
    protected function render($template, $data = [])
    {
        return $this->getResponse()->write(View::render($template, $data));
    }

    /**
     * Render data variable as application/json string
     *
     * @param array|object $data
     * @param int|null     $status The redirect HTTP status code.
     *
     * @return \Slim\Http\Response
     */
    protected function renderJSON($data = [], $status = null)
    {
        return $this->getResponse()->withJson($data, $status, JSON_PRETTY_PRINT);
    }


    /**
     * Redirect to URL with optional status
     *
     * @param string|UriInterface $url    The redirect destination.
     * @param int|null            $status The redirect HTTP status code.
     *
     * @return \Slim\Http\Response
     */
    protected function redirect($url, $status = null)
    {
        return $this->getResponse()->withRedirect($url, $status);
    }

    /**
     * Catch certain undefined properties and deliver something useful.
     *
     * @param $name
     * @return mixed
     */
    function __get($name)
    {
        if ($name === 'session') {
            return Session::instance();
        }

        if ($name === 'config') {
            return Config::instance();
        }

        return null;
    }

{'fraction_non_alphanumeric': 0.13776192599197504, 'fraction_numerical': 0.0, 'mean_word_length': 2.077503429355281, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '6778815', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1288, 'n_words': 309}