GeneratorUnit   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
dl 0
loc 75
c 0
b 0
f 0
wmc 7
lcom 0
cbo 1
ccs 18
cts 21
cp 0.8571
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getGeneratorMapping() 0 4 1
A setGeneratorMapping() 0 4 1
A getGenerationSeed() 0 4 1
A setGenerationSeed() 0 4 1
A getGenerationContributions() 0 4 1
A setGenerationContributions() 0 4 1
1
<?php
2
3
namespace Maketok\DataMigration\Unit\Type;
4
5
use Maketok\DataMigration\Unit\GenerateUnitInterface;
6
7
abstract class GeneratorUnit extends ExportFileUnit implements GenerateUnitInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $generatorMapping;
13
    /**
14
     * @var array
15
     */
16
    protected $generationContributions = [];
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $generationContributions exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
17
    /**
18
     * Max number and center of dispersion
19
     * @var \SplFixedArray
20
     */
21
    protected $generationSeed;
22
23
    /**
24
     * @param string $code
25
     */
26 55
    public function __construct($code)
27
    {
28 55
        parent::__construct($code);
29 55
        $this->generationSeed = new \SplFixedArray(2);
30 55
        $this->generationSeed[0] = 1;
31 55
        $this->generationSeed[1] = 1;
32 55
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 6
    public function getGeneratorMapping()
38
    {
39 6
        return $this->generatorMapping;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 5
    public function setGeneratorMapping(array $generatorMapping)
46
    {
47 5
        $this->generatorMapping = $generatorMapping;
48 5
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 5
    public function getGenerationSeed()
54
    {
55 5
        return $this->generationSeed;
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61 6
    public function setGenerationSeed(\SplFixedArray $generationSeed)
62
    {
63 6
        $this->generationSeed = $generationSeed;
64 6
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69 5
    public function getGenerationContributions()
70
    {
71 5
        return $this->generationContributions;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function setGenerationContributions(array $generationContributions)
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $generationContributions exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
78
    {
79
        $this->generationContributions = $generationContributions;
80
    }
81
}
82