CountrySelect   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Form\Field;
6
7
use Bone\User\Form\Transformer\CountryTransformer;
0 ignored issues
show
Bug introduced by
The type Bone\User\Form\Transformer\CountryTransformer 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 Del\Repository\CountryRepository;
9
10
class CountrySelect extends Select
11
{
12
    public function init(): void
13
    {
14
        parent::init();
15
        $this->setLabel('Country');
16
        $this->setTransformer(new CountryTransformer());
17
        $countryRepository = new CountryRepository();
18
        $countries = $countryRepository->findAllCountries();
19
        $this->setOption('', '');
20
21
        foreach ($countries as $c) {
22
            $this->setOption($c->getIso(), $c->getName());
23
        }
24
    }
25
}
26