Completed
Push — master ( 9f1a25...922242 )
by De Cramer
10s
created

SimpleGroupingFactory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Oliverde8\Component\PhpEtl\Builder\Factories\Grouping;
4
5
use Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
/**
9
 * Class SimpleGroupingFactory
10
 *
11
 * @author    de Cramer Oliver<[email protected]>
12
 * @copyright 2018 Oliverde8
13
 * @package Oliverde8\Component\PhpEtl\Builder\Factories\Grouping
14
 */
15
class SimpleGroupingFactory extends AbstractFactory
16
{
17
    /**
18
     * @inheritdoc
19
     */
20
    public function build($operation, $options)
21
    {
22
        return $this->create($options['grouping-key'], $options['group-identifier']);
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    protected function configureValidator()
29
    {
30
        return new Assert\Collection([
31
             'grouping-key' => new Assert\NotBlank(),
32
             'group-identifier' => new Assert\Optional()
33
         ]);
34
    }
35
36
}