Skip to content
Snippets Groups Projects

Draft: Resolve #3495440 "Declaration of drupalserializationnormalizeranynormalizernormalize"

2 files
+ 16
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -20,7 +20,14 @@ class MenuLinkNormalizer extends NormalizerBase {
/**
* {@inheritdoc}
*/
public function normalize($object, $format = NULL, array $context = []) {
public function supportsNormalization($data, ?string $format = null, array $context = []): bool {
return $data instanceof MenuLinkInterface;
}
/**
* {@inheritdoc}
*/
public function normalize($object, ?string $format = NULL, array $context = []): array {
/** @var \Drupal\Core\Menu\MenuLinkInterface $object */
return [
'id' => $object->getPluginId(),
Loading