Skip to content

Commit ee43709

Browse files
committed
Fix docblock supportsTransformation.
1 parent 96bfc4d commit ee43709

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/DataTransformer/DataTransformerInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ interface DataTransformerInterface
3131
public function transform($object, string $to, array $context = []);
3232

3333
/**
34-
* Checks whether the transformation is supported for a given object and context.
34+
* Checks whether the transformation is supported for a given data and context.
3535
*
36-
* @param object $object
36+
* @param object|array $data object on normalize / array on denormalize
3737
*/
38-
public function supportsTransformation($object, string $to, array $context = []): bool;
38+
public function supportsTransformation($data, string $to, array $context = []): bool;
3939
}

src/Serializer/AbstractItemNormalizer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,11 +605,13 @@ protected function normalizeRelation(PropertyMetadata $propertyMetadata, $relate
605605

606606
/**
607607
* Finds the first supported data transformer if any.
608+
*
609+
* @param object|array $data object on normalize / array on denormalize
608610
*/
609-
protected function getDataTransformer($object, string $to, array $context = []): ?DataTransformerInterface
611+
protected function getDataTransformer($data, string $to, array $context = []): ?DataTransformerInterface
610612
{
611613
foreach ($this->dataTransformers as $dataTransformer) {
612-
if ($dataTransformer->supportsTransformation($object, $to, $context)) {
614+
if ($dataTransformer->supportsTransformation($data, $to, $context)) {
613615
return $dataTransformer;
614616
}
615617
}

0 commit comments

Comments
 (0)