Company   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 13
dl 0
loc 35
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A company() 0 5 1
A jobTitle() 0 5 1
A companySuffix() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace DummyGenerator\Core;
6
7
use DummyGenerator\Definitions\Extension\Awareness\GeneratorAwareExtensionInterface;
8
use DummyGenerator\Definitions\Extension\Awareness\GeneratorAwareExtensionTrait;
9
use DummyGenerator\Definitions\Extension\Awareness\RandomizerAwareExtensionInterface;
10
use DummyGenerator\Definitions\Extension\Awareness\RandomizerAwareExtensionTrait;
11
use DummyGenerator\Definitions\Extension\CompanyExtensionInterface;
12
13
class Company implements CompanyExtensionInterface, GeneratorAwareExtensionInterface, RandomizerAwareExtensionInterface
14
{
15
    use GeneratorAwareExtensionTrait;
16
    use RandomizerAwareExtensionTrait;
17
18
    /** @var string[]  */
19
    protected array $formats = [
20
        '{{lastName}} {{companySuffix}}',
21
    ];
22
23
    /** @var string[]  */
24
    protected array $companySuffix = ['Ltd'];
25
26
    /** @var string[]  */
27
    protected array $jobTitleFormat = [
28
        '{{word}}',
29
    ];
30
31 1
    public function company(): string
32
    {
33 1
        $format = $this->randomizer->randomElement($this->formats);
34
35 1
        return $this->generator->parse($format);
36
    }
37
38 2
    public function companySuffix(): string
39
    {
40 2
        return $this->randomizer->randomElement($this->companySuffix);
41
    }
42
43 1
    public function jobTitle(): string
44
    {
45 1
        $format = $this->randomizer->randomElement($this->jobTitleFormat);
46
47 1
        return $this->generator->parse($format);
48
    }
49
}
50