AbstractMediaNormalizer::supportsNormalization()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Actualys\Bundle\DrupalCommerceConnectorBundle\Normalizer\Attribute;
4
5
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
6
use Pim\Bundle\CatalogBundle\Entity\Attribute;
7
8
/**
9
 * Class AbstractMediaNormalizer
10
 *
11
 * @package Actualys\Bundle\DrupalCommerceConnectorBundle\Normalizer
12
 */
13
abstract class AbstractMediaNormalizer implements NormalizerInterface
14
{
15
    /**
16
     * Checks whether the given class is supported for normalization by this normalizer
17
     *
18
     * @param mixed  $data   Data to normalize.
19
     * @param string $format The format being (de-)serialized from or into.
20
     *
21
     * @return boolean
22
     */
23
    public function supportsNormalization($data, $format = null)
24
    {
25
        return $data instanceof Attribute;
26
    }
27
}
28