ReferenceDataToFlatArrayProcessor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A process() 0 4 1
1
<?php
2
3
namespace Pim\Bundle\CustomEntityBundle\MassEditConnector\Processor;
4
5
use Pim\Bundle\EnrichBundle\Connector\Processor\AbstractProcessor;
6
use Pim\Component\Connector\Repository\JobConfigurationRepositoryInterface;
7
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
8
9
/**
10
 * Processor to quick export reference datas
11
 *
12
 * @author Romain Monceau <[email protected]>
13
 */
14
class ReferenceDataToFlatArrayProcessor extends AbstractProcessor
15
{
16
    /** @var NormalizerInterface */
17
    protected $normalizer;
18
19
    /**
20
     * @param JobConfigurationRepositoryInterface $jobConfigurationRepo
21
     * @param NormalizerInterface                 $normalizer
22
     */
23
    public function __construct(
24
        JobConfigurationRepositoryInterface $jobConfigurationRepo,
25
        NormalizerInterface $normalizer
26
    ) {
27
        parent::__construct($jobConfigurationRepo);
28
29
        $this->normalizer = $normalizer;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function process($item)
36
    {
37
        return $this->normalizer->normalize($item, 'flat');
38
    }
39
}
40