AddressTypeExtension::getExtendedTypes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewebe\SyliusVATPlugin\Form\Extension;
6
7
use Gewebe\SyliusVATPlugin\Config\VatNumberValidatorConfig;
0 ignored issues
show
Bug introduced by
The type Gewebe\SyliusVATPlugin\C...atNumberValidatorConfig was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Sylius\Bundle\AddressingBundle\Form\Type\AddressType;
9
use Symfony\Component\Form\AbstractTypeExtension;
10
use Symfony\Component\Form\Extension\Core\Type\TextType;
11
use Symfony\Component\Form\FormBuilderInterface;
12
13
class AddressTypeExtension extends AbstractTypeExtension
14
{
15
    public function __construct(
16
        private readonly VatNumberValidatorConfig $vatNumberValidatorConfig,
17
    ) {
18
    }
19
20
    public function buildForm(FormBuilderInterface $builder, array $options): void
21
    {
22
        $builder->add(
23
            'vatNumber',
24
            TextType::class,
25
            [
26
                'label' => 'gewebe_sylius_vat_plugin.ui.vat_number',
27
                'required' => $this->vatNumberValidatorConfig->isRequired,
28
            ],
29
        );
30
    }
31
32
    public static function getExtendedTypes(): array
33
    {
34
        return [
35
            AddressType::class,
36
        ];
37
    }
38
}
39