<commit_before><?php

namespace AWurth\SilexUser\Controller;

use AWurth\SilexUser\Entity\User;
use Silex\Application;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;

/**
 * Silex User Authentication Controller.
 *
 * @author <NAME> <<EMAIL>>
 */
class AuthController
{
    public function loginAction(Application $app, Request $request)
    {
        return $app['twig']->render('silex_user/auth/login.twig', [
            'error' => $app['security.last_error']($request),
            'last_username' => $app['session']->get('_security.last_username')
        ]);
    }

    public function registerAction(Application $app, Request $request)
    {
        $user = new User();

        /** @var FormInterface $form */
        $form = $app['form.factory']->createBuilder(FormType::class, $user)
            ->add('username', TextType::class)
            ->add('email', EmailType::class)
            ->add('password', RepeatedType::class, [
                'type' => PasswordType::class,
                'first_name' => 'password',
                'second_name' => 'confirm_password',
                'invalid_message' => 'The password fields must match.'
            ])
            ->getForm();
<commit_msg>Use configured User class instead of the mapped superclass<commit_after><?php

namespace AWurth\SilexUser\Controller;

use AWurth\SilexUser\Entity\User;
use Silex\Application;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;

/**
 * Silex User Authentication Controller.
 *
 * @author <NAME> <<EMAIL>>
 */
class AuthController
{
    public function loginAction(Application $app, Request $request)
    {
        return $app['twig']->render('silex_user/auth/login.twig', [
            'error' => $app['security.last_error']($request),
            'last_username' => $app['session']->get('_security.last_username')
        ]);
    }

    public function registerAction(Application $app, Request $request)
    {
        $user = new $app['silex_user.user_class']();

        /** @var FormInterface $form */
        $form = $app['form.factory']->createBuilder(FormType::class, $user)
            ->add('username', TextType::class)
            ->add('email', EmailType::class)
            ->add('password', RepeatedType::class, [
                'type' => PasswordType::class,
                'first_name' => 'password',
                'second_name' => '<PASSWORD>',
                'invalid_message' => 'The password fields must match.'
            ])
            ->getForm();

{'fraction_non_alphanumeric': 0.14126611957796015, 'fraction_numerical': 0.0, 'mean_word_length': 3.320253164556962, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 36, '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': '344381', 'n_tokens_mistral': 993, 'n_tokens_neox': 984, 'n_words': 168}