Completed
Push — EZP-31677 ( f9ca3f )
by
unknown
17:34
created

CompoundMatcherNormalizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 8 1
A supportsNormalization() 0 4 1
1
<?php
2
3
namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;
4
5
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher;
6
use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
7
8
class CompoundMatcherNormalizer extends PropertyNormalizer
9
{
10
    /**
11
     * {@inheritdoc}.
12
     */
13
    public function normalize($object, $format = null, array $context = array())
14
    {
15
        $data = parent::normalize($object, $format, $context);
16
        $data['config'] = [];
17
        $data['matchersMap'] = [];
18
19
        return $data;
20
    }
21
22
    /**
23
     * {@inheritdoc}.
24
     */
25
    public function supportsNormalization($data, $format = null)
26
    {
27
        return $data instanceof Matcher\Compound;
28
    }
29
}
30