public function accept($data, array $type = null) { return $this->navigator->accept($data, $type, $this); }
public function deserialize($data, $type, $format) { $visitor = $this->deserializationVisitors->get($format)->get(); $visitor->setNavigator($navigator = new GraphNavigator(GraphNavigator::DIRECTION_DESERIALIZATION, $this->factory, $format, $this->handlerRegistry, $this->objectConstructor, $this->exclusionStrategy, $this->dispatcher)); $navigatorResult = $navigator->accept($visitor->prepare($data), $this->typeParser->parse($type), $visitor); // This is a special case if the root is handled by a callback on the object iself. if (null === ($visitorResult = $visitor->getResult()) && null !== $navigatorResult) { return $navigatorResult; } return $visitorResult; }