Completed
Push — 4.0 ( 268f2c...88f012 )
by Hideki
05:48 queued 10s
created

src/Eccube/Form/Type/Master/PaymentType.php (1 issue)

Upgrade to new PHP Analysis Engine

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) EC-CUBE CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.ec-cube.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\Master;
15
16
use Doctrine\ORM\EntityRepository;
17
use Eccube\Form\Type\MasterType;
18
use Symfony\Component\Form\AbstractType;
19
use Symfony\Component\OptionsResolver\OptionsResolver;
20
21 View Code Duplication
class PaymentType extends AbstractType
0 ignored issues
show
This class seems to be duplicated in your project.

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.

Loading history...
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 22
    public function configureOptions(OptionsResolver $resolver)
27
    {
28 22
        $resolver->setDefaults([
29 22
            'class' => 'Eccube\Entity\Payment',
30 22
            'choice_label' => 'method',
31 22
            'placeholder' => '-',
32
            // fixme 何故かここはDESC
33 22
            'query_builder' => function (EntityRepository $er) {
34 22
                return $er->createQueryBuilder('m')
35 22
                    ->orderBy('m.sort_no', 'DESC');
36 22
            },
37
        ]);
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43 14
    public function getBlockPrefix()
44
    {
45 14
        return 'payment';
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51 22
    public function getParent()
52
    {
53 22
        return MasterType::class;
54
    }
55
}
56