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 ( 8619f1...53d2ad )
by Ross
52s queued 13s
created

IpAddressFakerData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 5 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
    public function __construct(Generator $generator)
21
    {
22
        $this->generator = $generator;
23
    }
24
25
    public function __invoke(): string
26
    {
27
        $pseudoProperty = self::FAKER_IP_ADDRESS_FORMATTERS[array_rand(self::FAKER_IP_ADDRESS_FORMATTERS)];
28
29
        return $this->generator->$pseudoProperty;
30
    }
31
}
32