Completed
Push — 6.13 ( fb0043...d86c76 )
by André
18:03
created

URIElementNormalizer::supportsNormalization()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;
10
11
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement;
12
13
final class URIElementNormalizer extends AbstractPropertyWhitelistNormalizer
14
{
15
    public function supportsNormalization($data, $format = null)
16
    {
17
        return $data instanceof URIElement;
18
    }
19
20
    /**
21
     * @see \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement::__sleep
22
     */
23
    protected function getAllowedProperties(): array
24
    {
25
        return ['elementNumber', 'uriElements'];
26
    }
27
}
28