<commit_before><?php

namespace Bolt\Extension\Bolt\Members\Form;

use Bolt\Extension\Bolt\Members\Form\Builder\MembersFormBuilderInterface;
use Bolt\Extension\Bolt\Members\Form\Entity\EntityInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormTypeInterface;

/**
 * Resolved form building class.
 *
 * Copyright (C) 2014-2016 <NAME>
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2014-2016, <NAME>
 * @license   https://opensource.org/licenses/MIT MIT
 */
class ResolvedFormBuild
{
    /** @var MembersFormBuilderInterface[] */
    private $formBuilder;
    /** @var FormInterface[] */
    protected $form;
    /** @var array */
    protected $context;

    /**
     * Add a builder and form.
     *
     * @param string                      $formName
     * @param MembersFormBuilderInterface $formBuilder
     * @param FormInterface               $form
     *
     * @return ResolvedFormBuild
     */
    public function addBuild($formName, MembersFormBuilderInterface $formBuilder, FormInterface $form)
    {
        $this->formBuilder[$formName] = $formBuilder;
        $this->form[$formName] = $form;

        return $this;
    }

    /**
     * @param $formName
     *
     * @return MembersFormBuilderInterface
     */
    public function getFormBuilder($formName)
    {
        return $this->formBuilder[$formName];
    }

    /**
     * Return the Symfony Form object.
     *
     * @param string $formName
     *
     * @throws \BadMethodCallException
     *
     * @return FormInterface
     */
    public function getForm($formName)
    {
        if (!isset($this->form[$formName])) {
            throw new \BadMethodCallException(sprintf('Form %s not found.', $formName));
        }

        return $this->form[$formName];
    }

    /**
     * Add a form.
     *
     * @param FormInterface $form
     *
     * @return ResolvedFormBuild
     */
    public function setForm(FormInterface $form)
    {
        $formName = sprintf('form_%s', $form->getName());
        $this->form[$formName] = $form;

        return $this;
    }<commit_msg>Tweak exception message<commit_after><?php

namespace Bolt\Extension\Bolt\Members\Form;

use Bolt\Extension\Bolt\Members\Form\Builder\MembersFormBuilderInterface;
use Bolt\Extension\Bolt\Members\Form\Entity\EntityInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormTypeInterface;

/**
 * Resolved form building class.
 *
 * Copyright (C) 2014-2016 <NAME>
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2014-2016, <NAME>
 * @license   https://opensource.org/licenses/MIT MIT
 */
class ResolvedFormBuild
{
    /** @var MembersFormBuilderInterface[] */
    private $formBuilder;
    /** @var FormInterface[] */
    protected $form;
    /** @var array */
    protected $context;

    /**
     * Add a builder and form.
     *
     * @param string                      $formName
     * @param MembersFormBuilderInterface $formBuilder
     * @param FormInterface               $form
     *
     * @return ResolvedFormBuild
     */
    public function addBuild($formName, MembersFormBuilderInterface $formBuilder, FormInterface $form)
    {
        $this->formBuilder[$formName] = $formBuilder;
        $this->form[$formName] = $form;

        return $this;
    }

    /**
     * @param $formName
     *
     * @return MembersFormBuilderInterface
     */
    public function getFormBuilder($formName)
    {
        return $this->formBuilder[$formName];
    }

    /**
     * Return the Symfony Form object.
     *
     * @param string $formName
     *
     * @throws \BadMethodCallException
     *
     * @return FormInterface
     */
    public function getForm($formName)
    {
        if (!isset($this->form[$formName])) {
            $message = sprintf(
                'Requested form "%s" not part of this build. Available forms: %s',
                $formName,
                implode(', ', array_keys($this->form))
            );
            throw new \BadMethodCallException($message);
        }

        return $this->form[$formName];
    }

    /**
     * Add a form.
     *
     * @param FormInterface $form
     *
     * @return ResolvedFormBuild
     */
    public function setForm(FormInterface $form)
    {
        $formName = sprintf('form_%s', $form->getName());
        $this->form[$formName] = $form;

        return $this;
    }
{'fraction_non_alphanumeric': 0.12807657247037374, 'fraction_numerical': 0.007292616226071103, 'mean_word_length': 2.3325740318906605, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 28, 'https://': 2, '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': '5192242', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1266, 'n_words': 268}