AbstractType::buildView()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentsBundle\Form;
15
16
use Silverback\ApiComponentsBundle\Helper\Form\FormSubmitHelper;
17
use Symfony\Component\Form\AbstractType as BaseAbstractType;
18
use Symfony\Component\Form\FormInterface;
19
use Symfony\Component\Form\FormView;
20
21
/**
22
 * @author Daniel West <[email protected]>
23
 */
24
class AbstractType extends BaseAbstractType implements FormTypeInterface
25
{
26
    public function buildView(FormView $view, FormInterface $form, array $options): void
27
    {
28
        $view->vars[FormSubmitHelper::FORM_REALTIME_VALIDATE_DISABLED] = $options[FormSubmitHelper::FORM_REALTIME_VALIDATE_DISABLED] ?? false;
29
        $view->vars[FormSubmitHelper::FORM_API_DISABLED] = $options[FormSubmitHelper::FORM_API_DISABLED] ?? false;
30
        $view->vars[FormSubmitHelper::FORM_POST_APP_PROXY] = $options[FormSubmitHelper::FORM_POST_APP_PROXY] ?? null;
31
    }
32
}
33