These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of EC-CUBE |
||
5 | * |
||
6 | * Copyright(c) LOCKON CO.,LTD. All Rights Reserved. |
||
7 | * |
||
8 | * http://www.lockon.co.jp/ |
||
9 | * |
||
10 | * For the full copyright and license information, please view the LICENSE |
||
11 | * file that was distributed with this source code. |
||
12 | */ |
||
13 | |||
14 | namespace Eccube\Form\Type\Front; |
||
15 | |||
16 | use Eccube\Common\EccubeConfig; |
||
17 | use Eccube\Form\Validator\Email; |
||
18 | use Symfony\Component\Form\AbstractType; |
||
19 | use Symfony\Component\Form\Extension\Core\Type\EmailType; |
||
20 | use Symfony\Component\Form\FormBuilderInterface; |
||
21 | use Symfony\Component\Validator\Constraints as Assert; |
||
22 | |||
23 | /** |
||
24 | * Class ForgotType |
||
25 | */ |
||
26 | View Code Duplication | class ForgotType extends AbstractType |
|
0 ignored issues
–
show
|
|||
27 | { |
||
28 | /** |
||
29 | * @var EccubeConfig |
||
30 | */ |
||
31 | protected $eccubeConfig; |
||
32 | |||
33 | /** |
||
34 | * ForgotType constructor. |
||
35 | * |
||
36 | * @param EccubeConfig $eccubeConfig |
||
37 | 7 | */ |
|
38 | public function __construct(EccubeConfig $eccubeConfig) |
||
39 | 7 | { |
|
40 | $this->eccubeConfig = $eccubeConfig; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | 7 | */ |
|
46 | public function buildForm(FormBuilderInterface $builder, array $options) |
||
47 | 7 | { |
|
48 | $builder->add('login_email', EmailType::class, [ |
||
49 | 7 | 'attr' => [ |
|
50 | 'max_length' => $this->eccubeConfig['eccube_stext_len'], |
||
51 | ], |
||
52 | 7 | 'constraints' => [ |
|
53 | 7 | new Assert\NotBlank(), |
|
54 | new Email(['strict' => $this->eccubeConfig['eccube_rfc_email_check']]), |
||
55 | ], |
||
56 | ]); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | 7 | */ |
|
62 | public function getBlockPrefix() |
||
63 | 7 | { |
|
64 | return 'forgot'; |
||
65 | } |
||
66 | } |
||
67 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.