Skip to content

Commit 84fd0d9

Browse files
authored
Merge pull request #858 from soyuka/fix-fetch-data
fix override fetch_data context
2 parents 0357a41 + e2396f6 commit 84fd0d9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/JsonLd/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
9595
throw new InvalidArgumentException('Update is not allowed for this operation.');
9696
}
9797

98-
$context['object_to_populate'] = $this->iriConverter->getItemFromIri($data['@id'], ['fetch_data' => false] + $context);
98+
$context['object_to_populate'] = $this->iriConverter->getItemFromIri($data['@id'], $context + ['fetch_data' => false]);
9999
}
100100

101101
return parent::denormalize($data, $class, $format, $context);

src/Serializer/AbstractItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private function denormalizeRelation(string $attributeName, PropertyMetadata $pr
272272
{
273273
if (is_string($value)) {
274274
try {
275-
return $this->iriConverter->getItemFromIri($value, ['fetch_data' => false] + $context);
275+
return $this->iriConverter->getItemFromIri($value, $context + ['fetch_data' => false]);
276276
} catch (InvalidArgumentException $e) {
277277
// Give a chance to other normalizers (e.g.: DateTimeNormalizer)
278278
}

src/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
3333
throw new InvalidArgumentException('Update is not allowed for this operation.');
3434
}
3535

36-
$context['object_to_populate'] = $this->iriConverter->getItemFromIri($data['id'], ['fetch_data' => false] + $context);
36+
$context['object_to_populate'] = $this->iriConverter->getItemFromIri($data['id'], $context + ['fetch_data' => false]);
3737
}
3838

3939
return parent::denormalize($data, $class, $format, $context);

0 commit comments

Comments
 (0)