<commit_before><?php namespace FWM\LaravelAVP;

use FWM\LaravelAVP\Validation;
use Illuminate\Routing\Redirector;
use FWM\LaravelAVP\RequestHandler;
use Illuminate\View\Factory as View;
use Illuminate\Session\Store as Session;
use Illuminate\Config\Repository as Config;
use Illuminate\Translation\Translator as Lang;

class AVPController extends \BaseController
{

    /**
     * @var Session
     */
    protected $session;

    /**
     * @var Config
     */
    protected $config;

    /**
     * @var Lang
     */
    protected $lang;

    /**
     * @var Redirector
     */
    protected $redirector;

    /**
     * @var View
     */
    protected $view;

    /**
     * @var RequestHandler
     */
    protected $handler;

    /**
     * @var Validation
     */
    protected $validation;

    /**
     * @param Session $session
     * @param Config $config
     * @param Lang $lang
     * @param Redirector $redirector
     * @param View $view
     * @param RequestHandler $handler
     * @param Validation $validation
     */
    function __construct(Session $session,
                         Config $config,
                         Lang $lang,
                         Redirector $redirector,
                         View $view,
                         RequestHandler $handler,
                         Validation $validation)
    {
        $this->session = $session;
        $this->config = $config;
        $this->lang = $lang;
        $this->redirector = $redirector;
        $this->view = $view;
        $this->handler = $handler;
        $this->validation = $validation;
    }

    /**
     * Renders the age gate view
     */
    public function agegate()
    {
        $previousTooYoung = $this->session->get('laravel-avp.previous_too_young');
        $view = $this->view->make($this->config->get('laravel-avp::view'))
            ->with(compact('previousTooYoung'));

        if (!$this->session->has('errors') && $previousTooYoung) {
            $messages = $this->lang->get('laravel-avp::validation.custom');
            $errorMsg = $messages['dob.previous'];
            $view->withErrors(['dob' => [$errorMsg]]);<commit_msg>Added parent constructor to the AVP Controller<commit_after><?php namespace FWM\LaravelAVP;

use FWM\LaravelAVP\Validation;
use Illuminate\Routing\Redirector;
use FWM\LaravelAVP\RequestHandler;
use Illuminate\View\Factory as View;
use Illuminate\Session\Store as Session;
use Illuminate\Config\Repository as Config;
use Illuminate\Translation\Translator as Lang;

class AVPController extends \BaseController
{

    /**
     * @var Session
     */
    protected $session;

    /**
     * @var Config
     */
    protected $config;

    /**
     * @var Lang
     */
    protected $lang;

    /**
     * @var Redirector
     */
    protected $redirector;

    /**
     * @var View
     */
    protected $view;

    /**
     * @var RequestHandler
     */
    protected $handler;

    /**
     * @var Validation
     */
    protected $validation;

    /**
     * @param Session $session
     * @param Config $config
     * @param Lang $lang
     * @param Redirector $redirector
     * @param View $view
     * @param RequestHandler $handler
     * @param Validation $validation
     */
    function __construct(Session $session,
                         Config $config,
                         Lang $lang,
                         Redirector $redirector,
                         View $view,
                         RequestHandler $handler,
                         Validation $validation)
    {
        $this->session = $session;
        $this->config = $config;
        $this->lang = $lang;
        $this->redirector = $redirector;
        $this->view = $view;
        $this->handler = $handler;
        $this->validation = $validation;
        
        parent::__construct();
    }

    /**
     * Renders the age gate view
     */
    public function agegate()
    {
        $previousTooYoung = $this->session->get('laravel-avp.previous_too_young');
        $view = $this->view->make($this->config->get('laravel-avp::view'))
            ->with(compact('previousTooYoung'));

        if (!$this->session->has('errors') && $previousTooYoung) {
            $messages = $this->lang->get('laravel-avp::validation.custom');
            $errorMsg = $messages['dob.previous'];
            $view->withErrors(['dob' => [$errorMsg]]);
{'fraction_non_alphanumeric': 0.13234285714285715, 'fraction_numerical': 0.0, 'mean_word_length': 1.938885157824043, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '649149', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1218, 'n_words': 264}