Passed
Pull Request — master (#9)
by
unknown
09:21
created

JsonFormProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addTypeToForm() 0 8 1
1
<?php
2
3
namespace oliverde8\ComfyBundle\Resolver\Form;
4
5
use oliverde8\ComfyBundle\Model\ConfigInterface;
6
use Symfony\Component\Form\FormInterface;
7
8
class JsonFormProvider extends SimpleFormProvider
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function addTypeToForm(string $name, ConfigInterface $config, FormInterface $formBuilder, string $scope)
14
    {
15
        $formBuilder->add(
16
            $name,
17
            $this->formType,
18
            [
19
                'label' => $config->getName(),
20
                'data' => $config->get($scope),
21
            ],
22
        );
23
    }
24
}
25