Skip to content

Commit

Permalink
Fix badly generated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-you committed Jan 31, 2024
1 parent fa0835c commit 22d334d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Runtime/Normalizer/ReferenceNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ class ReferenceNormalizer implements NormalizerInterface
public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$ref = [];
$ref['$ref'] = (string) $object->getReferenceUri();
$ref['$ref'] = (string)$object->getReferenceUri();

return $ref;
}

public function supportsNormalization($data, $format = null): bool
public function supportsNormalization($data, $format = null, array $context = []): bool
{
return $data instanceof Reference;
}

public function getSupportedTypes(?string $format): array
{
return [
Reference::class
];
}
}

0 comments on commit 22d334d

Please sign in to comment.