interface ContextAwareNormalizerInterface implements NormalizerInterface

Adds the support of an extra $context parameter for the supportsNormalization method.

Methods

array|string|int|float|bool
normalize(mixed $object, string $format = null, array $context = [])

Normalizes an object into a set of arrays/scalars.

bool
supportsNormalization(mixed $data, string $format = null, array $context = [])

Checks whether the given class is supported for normalization by this normalizer.

Details

in NormalizerInterface at line 39
array|string|int|float|bool normalize(mixed $object, string $format = null, array $context = [])

Normalizes an object into a set of arrays/scalars.

Parameters

mixed $object Object to normalize
string $format Format the normalization result will be encoded as
array $context Context options for the normalizer

Return Value

array|string|int|float|bool

Exceptions

InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer
CircularReferenceException Occurs when the normalizer detects a circular reference when no circular reference handler can fix it
LogicException Occurs when the normalizer is not called in an expected context

at line 26
bool supportsNormalization(mixed $data, string $format = null, array $context = [])

Checks whether the given class is supported for normalization by this normalizer.

Parameters

mixed $data Data to normalize
string $format The format being (de-)serialized from or into
array $context

Return Value

bool