AbstractService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 19
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkRequest() 0 10 1
1
<?php
2
namespace OmnideskBundle\Service;
3
4
use OmnideskBundle\DataTransformer\DataTransformerInterface;
5
use OmnideskBundle\Request\RequestInterface;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
use Symfony\Component\Config\Definition\Processor;
8
9
/**
10
 * Class AbstractService
11
 * @package OmnideskBundle\Service
12
 */
13
abstract class AbstractService
14
{
15
    /**
16
     * @param RequestInterface         $request
17
     * @param DataTransformerInterface $transformer
18
     * @param ConfigurationInterface   $configuration
19
     * @return array
20
     */
21
    protected function checkRequest(
22
        RequestInterface $request,
23
        DataTransformerInterface $transformer,
24
        ConfigurationInterface $configuration
25
    ) {
26
        $processor = new Processor();
27
        $params = $transformer->transform($request);
28
29
        return $processor->processConfiguration($configuration, ['params' => array_filter($params)]);
30
    }
31
}
32