Completed
Push — develop ( 44ec0d...21eab1 )
by Michiel
02:03
created

VerifySmsChallengeType::getBlockPrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright 2014 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace Surfnet\StepupSelfService\SelfServiceBundle\Form\Type;
20
21
use Symfony\Component\Form\AbstractType;
22
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
23
use Symfony\Component\Form\Extension\Core\Type\TextType;
24
use Symfony\Component\Form\FormBuilderInterface;
25
use Symfony\Component\OptionsResolver\OptionsResolver;
26
27
class VerifySmsChallengeType extends AbstractType
28
{
29
    public function buildForm(FormBuilderInterface $builder, array $options)
30
    {
31
        $builder->add('challenge', TextType::class, [
32
            'label' => 'ss.form.ss_verify_sms_challenge.text.challenge',
33
            'required' => true,
34
            'attr' => ['autofocus' => true],
35
            'label_attr' => ['class' => 'pull-right'],
36
        ]);
37
        $builder->add('resendChallenge', AnchorType::class, [
38
            'label' => 'ss.form.ss_verify_sms_challenge.button.resend_challenge',
39
            'attr' => [ 'class' => 'btn btn-default' ],
40
            'route' => 'ss_registration_sms_send_challenge',
41
        ]);
42
        $builder->add('verifyChallenge', SubmitType::class, [
43
            'label' => 'ss.form.ss_verify_sms_challenge.button.verify_challenge',
44
            'attr' => [ 'class' => 'btn btn-primary pull-right' ],
45
        ]);
46
    }
47
48
    public function configureOptions(OptionsResolver $resolver)
49
    {
50
        $resolver->setDefaults([
51
            'data_class' => 'Surfnet\StepupSelfService\SelfServiceBundle\Command\VerifySmsChallengeCommand',
52
        ]);
53
    }
54
55
    public function getBlockPrefix()
56
    {
57
        return 'ss_verify_sms_challenge';
58
    }
59
}
60