Ejemplo n.º 1
0
 private function leaveScope(Context $context, $data)
 {
     if ($context instanceof SerializationContext) {
         $context->stopVisiting($data);
     } elseif ($context instanceof DeserializationContext) {
         $context->decreaseDepth();
     }
 }
Ejemplo n.º 2
0
 private function leaveScope(Context $context, $data)
 {
     if ($context instanceof SerializationContext) {
         //Visiting does not exist for primitive types
         if (!is_object($data) && $data !== null) {
             return;
         }
         $context->stopVisiting($data);
     } elseif ($context instanceof DeserializationContext) {
         $context->decreaseDepth();
     }
 }