Base   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A maxDistinct() 0 7 3
A __construct() 0 3 1
1
<?php
2
3
4
namespace Kaliop\eZLoremIpsumBundle\Faker\Provider;
5
6
use Faker\Generator;
7
use Kaliop\eZLoremIpsumBundle\Faker\MaxDistinctGenerator;
8
9
abstract class Base
10
{
11
    /** @var Generator $generator */
12
    protected $generator;
13
14
    /** @var MaxDistinctGenerator $distinct  */
15
    protected $distinct;
16
17
    public function __construct(Generator $generator)
18
    {
19
        $this->generator = $generator;
20
    }
21
22
    public function maxDistinct($maxElements = 100, $reset = false)
23
    {
24
        if ($reset || !$this->distinct) {
25
            $this->distinct = new MaxDistinctGenerator($this->generator, $maxElements);
26
        }
27
28
        return $this->distinct;
29
    }
30
}
31