Skip to content

Commit

Permalink
style: various cs fixes (#6504)
Browse files Browse the repository at this point in the history
* cs: fixes

* chore: phpstan fixes
  • Loading branch information
soyuka authored Aug 9, 2024
1 parent 8c0aafe commit 5c64dff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected function normalizeRelation(ApiProperty $propertyMetadata, ?object $rel

if (null === $relatedObject || isset($context['api_included'])) {
if (!$this->serializer instanceof NormalizerInterface) {
throw new LogicException(sprintf('The injected serializer must be an instance of "%s".', NormalizerInterface::class));
throw new LogicException(\sprintf('The injected serializer must be an instance of "%s".', NormalizerInterface::class));
}

$normalizedRelatedObject = $this->serializer->normalize($relatedObject, $format, $context);
Expand Down Expand Up @@ -422,7 +422,7 @@ private function getPopulatedRelations(object $object, ?string $format, array $c
// Many to many relationship
foreach ($attributeValue as $attributeValueElement) {
if (!isset($attributeValueElement['data'])) {
throw new UnexpectedValueException(sprintf('The JSON API attribute \'%s\' must contain a "data" key.', $relationshipName));
throw new UnexpectedValueException(\sprintf('The JSON API attribute \'%s\' must contain a "data" key.', $relationshipName));
}
unset($attributeValueElement['data']['attributes']);
$data[$relationshipName]['data'][] = $attributeValueElement['data'];
Expand Down

0 comments on commit 5c64dff

Please sign in to comment.