Code Duplication    Length = 13-13 lines in 2 locations

src/Pipeline/BusOperationsContextFactory.php 2 locations

@@ 27-39 (lines=13) @@
24
     *
25
     * @return OutgoingPublishContext
26
     */
27
    public function createPublishContext(
28
        $message,
29
        PublishOptions $options,
30
        PipelineStageContext $parentContext
31
    ) {
32
        return new OutgoingPublishContext(
33
            new OutgoingLogicalMessage($message),
34
            $options,
35
            $parentContext instanceof IncomingContext ? $parentContext->getIncomingPhysicalMessage() : null,
36
            $parentContext instanceof IncomingContext ? $parentContext->getPendingTransportOperations() : null,
37
            $parentContext
38
        );
39
    }
40
41
    /**
42
     * @param object               $message
@@ 48-60 (lines=13) @@
45
     *
46
     * @return OutgoingSendContext
47
     */
48
    public function createSendContext(
49
        $message,
50
        SendOptions $options,
51
        PipelineStageContext $parentContext
52
    ) {
53
        return new OutgoingSendContext(
54
            new OutgoingLogicalMessage($message),
55
            $options,
56
            $parentContext instanceof IncomingContext ? $parentContext->getIncomingPhysicalMessage() : null,
57
            $parentContext instanceof IncomingContext ? $parentContext->getPendingTransportOperations() : null,
58
            $parentContext
59
        );
60
    }
61
62
    /**
63
     * @param object          $message