Completed
Push — EZP-31287 ( fe8c5c...af9523 )
by
unknown
34:01
created

URIElementNormalizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A supportsNormalization() 0 4 1
A getAllowedProperties() 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\URIElement;
10
11
final class URIElementNormalizer extends AbstractPropertyWhitelistNormalizer
12
{
13
    public function supportsNormalization($data, $format = null)
14
    {
15
        return $data instanceof URIElement;
16
    }
17
18
    /**
19
     * @see \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement::__sleep
20
     */
21
    protected function getAllowedProperties()
22
    {
23
        return ['elementNumber', 'uriElements'];
24
    }
25
}
26