Completed
Push — EZP-31677-6.13-7.5 ( 743cfe )
by
unknown
17:29 queued 10s
created

CompoundMatcherNormalizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 8 1
A supportsNormalization() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;
8
9
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher;
10
use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
11
12
class CompoundMatcherNormalizer extends PropertyNormalizer
13
{
14
    public function normalize($object, $format = null, array $context = [])
15
    {
16
        $data = parent::normalize($object, $format, $context);
17
        $data['config'] = [];
18
        $data['matchersMap'] = [];
19
20
        return $data;
21
    }
22
23
    public function supportsNormalization($data, $format = null)
24
    {
25
        return $data instanceof Matcher\Compound;
26
    }
27
}
28