diff --git a/src/Headers/Handler/HeaderHandler.php b/src/Headers/Handler/HeaderHandler.php index cc7fc94..ed80ca4 100644 --- a/src/Headers/Handler/HeaderHandler.php +++ b/src/Headers/Handler/HeaderHandler.php @@ -15,8 +15,8 @@ use JMS\Serializer\Handler\SubscribingHandlerInterface; use JMS\Serializer\Metadata\StaticPropertyMetadata; use JMS\Serializer\SerializationContext; -use JMS\Serializer\XmlDeserializationVisitor; -use JMS\Serializer\XmlSerializationVisitor; +use JMS\Serializer\Visitor\DeserializationVisitorInterface; +use JMS\Serializer\Visitor\SerializationVisitorInterface; class HeaderHandler implements SubscribingHandlerInterface, EventSubscriberInterface { @@ -89,7 +89,7 @@ public function ensureHeaderSerialized(PreSerializeEvent $event): void /** * @return mixed */ - public function deserializeHeaderPlaceholder(XmlDeserializationVisitor $visitor, \SimpleXMLElement $data, array $type, DeserializationContext $context) + public function deserializeHeaderPlaceholder(DeserializationVisitorInterface $visitor, \SimpleXMLElement $data, array $type, DeserializationContext $context) { $type = ['name' => $type['params'][0], 'params' => []]; $headers = $context->getNavigator()->accept($data, $type, $context); @@ -111,7 +111,7 @@ public function deserializeHeaderPlaceholder(XmlDeserializationVisitor $visitor, /** * @return mixed */ - public function deserializeHeader(XmlDeserializationVisitor $visitor, \SimpleXMLElement $data, array $type, DeserializationContext $context) + public function deserializeHeader(DeserializationVisitorInterface $visitor, \SimpleXMLElement $data, array $type, DeserializationContext $context) { $type = ['name' => $type['params'][0], 'params' => []]; @@ -129,7 +129,7 @@ public function deserializeHeader(XmlDeserializationVisitor $visitor, \SimpleXML return $return; } - private function isMustUnderstand(\SimpleXMLElement $data, XmlDeserializationVisitor $visitor, DeserializationContext $context): bool + private function isMustUnderstand(\SimpleXMLElement $data, DeserializationVisitorInterface $visitor, DeserializationContext $context): bool { $domElement = dom_import_simplexml($data); $mustUnderstandAttr = $domElement->getAttributeNS($domElement->ownerDocument->documentElement->namespaceURI, 'mustUnderstand'); @@ -137,7 +137,7 @@ private function isMustUnderstand(\SimpleXMLElement $data, XmlDeserializationVis return !empty($mustUnderstandAttr) && $visitor->visitBoolean($mustUnderstandAttr, [], $context); } - public function serializeHeaderPlaceholder(XmlSerializationVisitor $visitor, object $data, array $type, SerializationContext $context): void + public function serializeHeaderPlaceholder(SerializationVisitorInterface $visitor, object $data, array $type, SerializationContext $context): void { // serialize default headers $context->stopVisiting($data); @@ -165,7 +165,7 @@ public function serializeHeaderPlaceholder(XmlSerializationVisitor $visitor, obj } } - public function serializeHeader(XmlSerializationVisitor $visitor, Header $header, array $type, SerializationContext $context): void + public function serializeHeader(SerializationVisitorInterface $visitor, Header $header, array $type, SerializationContext $context): void { $data = $header->getData(); if ($data instanceof \DOMElement) { @@ -192,7 +192,7 @@ public function serializeHeader(XmlSerializationVisitor $visitor, Header $header } } - private function handleOptions(XmlSerializationVisitor $visitor, array $options): void + private function handleOptions(SerializationVisitorInterface $visitor, array $options): void { if (!count($options)) { return; @@ -221,7 +221,7 @@ private function setAttributeOnNode(\DOMElement $node, string $name, $value, str $node->setAttributeNS($namespace, $prefix . ':' . $name, is_bool($value) || null === $value ? ($value ? 'true' : 'false') : $value); } - public function deserializeFaultDetail(XmlDeserializationVisitor $visitor, \SimpleXMLElement $data, array $type, DeserializationContext $context): \SimpleXMLElement + public function deserializeFaultDetail(DeserializationVisitorInterface $visitor, \SimpleXMLElement $data, array $type, DeserializationContext $context): \SimpleXMLElement { return $data->children(); }