Преглед на файлове

passes context to handlers

Johannes M. Schmitt преди 12 години
родител
ревизия
8857e04e1c
променени са 2 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 3 0
      src/JMS/Serializer/GenericSerializationVisitor.php
  2. 1 1
      src/JMS/Serializer/GraphNavigator.php

+ 3 - 0
src/JMS/Serializer/GenericSerializationVisitor.php

@@ -36,6 +36,9 @@ abstract class GenericSerializationVisitor extends AbstractVisitor
         $this->dataStack = new \SplStack;
     }
 
+    /**
+     * @return GraphNavigator
+     */
     public function getNavigator()
     {
         return $this->navigator;

+ 1 - 1
src/JMS/Serializer/GraphNavigator.php

@@ -167,7 +167,7 @@ final class GraphNavigator
                 // before loading metadata because the type name might not be a class, but
                 // could also simply be an artifical type.
                 if (null !== $handler = $this->handlerRegistry->getHandler($this->context->getDirection(), $type['name'], $this->context->getFormat())) {
-                    $rs = call_user_func($handler, $visitor, $data, $type);
+                    $rs = call_user_func($handler, $visitor, $data, $type, $this->context);
 
                     $this->context->stopVisiting($data);