<commit_before><?php namespace Stevenmaguire\Foundation;

use Illuminate\Support\MessageBag as MessageBag;

class FormBuilder extends \Illuminate\Html\FormBuilder
{

    /**
     * Local stash of errors from session
     *
     * @var Illuminate\Support\MessageBag
     */
    protected $local_errors;

    /**
     * Create new instance of this FormBuilder intercepter!
     *
     * @param  Illuminate\Routing\UrlGenerator   $url
     * @param  Illuminate\Html\HtmlBuilder       $html
     * @param  string                            $token
     * @param  Illuminate\Translation\Translator $translator
     * @param  mixed                             $errors
     *
     * @return void
     */
    public function __construct($html, $url, $token, $translator, $errors = null)
    {
        $this->local_errors = ($errors != null ? $errors : new MessageBag);
        parent::__construct($html, $url, $token, $translator);
    }

    /**
     * Create a email input field.
     *
     * @param  string  $name
     * @param  string  $value
     * @param  array   $options
     *
     * @return string
     */
    public function email($name, $value = NULL, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::email($name, $value, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }

    /**
     * Create a label.
     *
     * @param  string  $name
     * @param  string  $value
     * @param  array   $options
     *
     * @return string
     */
    public function label($name, $value = NULL, $options = [])
    {
        $this->addErrorClass($name, $options);
        return parent::label($name, $value, $options);
    }

    /**
     * Create a password input field.
     *
     * @param  string  $name
     * @param  string  $value
     * @param  array   $options
     *
     * @return string
     */
    public function password($name, $value = NULL, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::password($name, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }

    /**
     * Create a select box field.
     *
     * @param  string  $name
     * @param  array   $list
     * @param  string  $selected
     * @param  array   $options
     *
     * @return string
     */
    public function select($name, $list = array(), $selected = null, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::select($name, $list, $selected, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }

    /**
     * Create a select month field.
     *
     * @param  string  $name
     * @param  string  $selected
     * @param  array   $options<commit_msg>Fixed password field options argument<commit_after><?php namespace Stevenmaguire\Foundation;

use Illuminate\Support\MessageBag as MessageBag;

class FormBuilder extends \Illuminate\Html\FormBuilder
{

    /**
     * Local stash of errors from session
     *
     * @var Illuminate\Support\MessageBag
     */
    protected $local_errors;

    /**
     * Create new instance of this FormBuilder intercepter!
     *
     * @param  Illuminate\Routing\UrlGenerator   $url
     * @param  Illuminate\Html\HtmlBuilder       $html
     * @param  string                            $token
     * @param  Illuminate\Translation\Translator $translator
     * @param  mixed                             $errors
     *
     * @return void
     */
    public function __construct($html, $url, $token, $translator, $errors = null)
    {
        $this->local_errors = ($errors != null ? $errors : new MessageBag);
        parent::__construct($html, $url, $token, $translator);
    }

    /**
     * Create a email input field.
     *
     * @param  string  $name
     * @param  string  $value
     * @param  array   $options
     *
     * @return string
     */
    public function email($name, $value = NULL, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::email($name, $value, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }

    /**
     * Create a label.
     *
     * @param  string  $name
     * @param  string  $value
     * @param  array   $options
     *
     * @return string
     */
    public function label($name, $value = NULL, $options = [])
    {
        $this->addErrorClass($name, $options);
        return parent::label($name, $value, $options);
    }

    /**
     * Create a password input field.
     *
     * @param  string  $name
     * @param  array   $options
     *
     * @return string
     */
    public function password($name, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::password($name, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }

    /**
     * Create a select box field.
     *
     * @param  string  $name
     * @param  array   $list
     * @param  string  $selected
     * @param  array   $options
     *
     * @return string
     */
    public function select($name, $list = array(), $selected = null, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::select($name, $list, $selected, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }

    /**
     * Create a select month field.
     *
     * @param  string  $name
     * @param  string  $selected
     * @param  array   $options
{'fraction_non_alphanumeric': 0.14138232720909885, 'fraction_numerical': 0.0, 'mean_word_length': 2.0714669532509404, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '1359966', 'n_tokens_mistral': 1704, 'n_tokens_neox': 1717, 'n_words': 406}