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
Pull Request — master (#51)
by joseph
102:38 queued 99:24
created

IpAddressFakerData::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\FakerData\Attribute;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\FakerData\FakerDataProviderInterface;
6
use Faker\Generator;
7
8
class IpAddressFakerData implements FakerDataProviderInterface
9
{
10
    private const FAKER_IP_ADDRESS_FORMATTERS = [
11
        'ipv4',
12
        'ipv6',
13
        'localIpv4',
14
    ];
15
    /**
16
     * @var Generator
17
     */
18
    protected $generator;
19
20 1
    public function __construct(Generator $generator)
21
    {
22 1
        $this->generator = $generator;
23 1
    }
24
25 1
    public function __invoke(): string
26
    {
27 1
        $pseudoProperty = self::FAKER_IP_ADDRESS_FORMATTERS[array_rand(self::FAKER_IP_ADDRESS_FORMATTERS)];
28
29 1
        return $this->generator->$pseudoProperty;
30
    }
31
}
32