Code Duplication    Length = 11-11 lines in 2 locations

src/Navigator/EventNavigator.php 2 locations

@@ 69-79 (lines=11) @@
66
        $type = $type ?: $this->typeGuesser->guess($data);
67
        $serialization = $context->getDirection() === Direction::SERIALIZATION;
68
69
        if ($serialization) {
70
            $this->dispatcher->dispatch(
71
                SerializerEvents::PRE_SERIALIZE,
72
                $event = new PreSerializeEvent($data, $type, $context)
73
            );
74
        } else {
75
            $this->dispatcher->dispatch(
76
                SerializerEvents::PRE_DESERIALIZE,
77
                $event = new PreDeserializeEvent($data, $type, $context)
78
            );
79
        }
80
81
        $result = $this->navigator->navigate($data = $event->getData(), $context, $type = $event->getType());
82
@@ 83-93 (lines=11) @@
80
81
        $result = $this->navigator->navigate($data = $event->getData(), $context, $type = $event->getType());
82
83
        if ($serialization) {
84
            $this->dispatcher->dispatch(
85
                SerializerEvents::POST_SERIALIZE,
86
                new PostSerializeEvent($data, $type, $context)
87
            );
88
        } else {
89
            $this->dispatcher->dispatch(
90
                SerializerEvents::POST_DESERIALIZE,
91
                new PostDeserializeEvent($result, $type, $context)
92
            );
93
        }
94
95
        return $result;
96
    }