DateIntervalGeneratorFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
namespace DBFaker\Generators;
3
4
use DBFaker\Helpers\SchemaHelper;
5
use Doctrine\DBAL\Schema\Column;
6
use Doctrine\DBAL\Schema\Table;
7
8
class DateIntervalGeneratorFactory implements FakeDataGeneratorFactoryInterface
9
{
10
11
    /**
12
     * @param Table $table
13
     * @param Column $column
14
     * @param SchemaHelper $schemaHelper
15
     * @return FakeDataGeneratorInterface
16
     *
17
     */
18
    public function create(Table $table, Column $column, SchemaHelper $schemaHelper) : FakeDataGeneratorInterface
19
    {
20
        $unique = $schemaHelper->isColumnPartOfUniqueIndex($table, $column);
21
        return new DateIntervalGenerator($unique);
22
    }
23
}
24