GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( e4e275...7e47ac )
by joseph
07:04 queued 07:01
created

CountryCodeFakerData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 26
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 2
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\FakerData\String;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\FakerData\AbstractFakerDataProvider;
6
7
class CountryCodeFakerData extends AbstractFakerDataProvider
8
{
9
    /**
10
     * @see https://github.com/symfony/symfony/issues/18263
11
     * @see \Symfony\Component\Intl\Data\Generator\RegionDataGenerator
12
     */
13
    public const EXCLUDED_CODES = [
14
        'ZZ',
15
        'BV',
16
        'QO',
17
        'EU',
18
        'AN',
19
        'BV',
20
        'HM',
21
        'CP',
22
    ];
23
24 2
    public function __invoke()
25
    {
26
        //to prevent issues when using as an archetype, otherwise this gets replaced with the new field property name
27 2
        $property = 'country' . 'Code';
28
        do {
29 2
            $code = $this->generator->$property;
30 2
        } while (\in_array($code, self::EXCLUDED_CODES, true));
31
32 2
        return $code;
33
    }
34
}
35