Code Duplication    Length = 11-13 lines in 2 locations

src/Tidal/WampWatch/Stub/ClientSessionStub.php 2 locations

@@ 80-92 (lines=13) @@
77
     *
78
     * @throws \RuntimeException if the topic is unknown.
79
     */
80
    public function completeSubscription($topicName, $requestId = 1, $sessionId = 1)
81
    {
82
        if (!isset($this->subscriptions[$topicName])) {
83
            throw new \RuntimeException("No subscription to topic '$topicName' initiated.");
84
        }
85
86
        /* @var $futureResult Deferred */
87
        $futureResult = $this->subscriptions[$topicName];
88
        $result = new SubscribedMessage($requestId, $sessionId);
89
90
        $futureResult->resolve($result);
91
    }
92
93
    /**
94
     * Publish.
95
     *
@@ 121-131 (lines=11) @@
118
     *
119
     * @throws \RuntimeException if the topic is unknown.
120
     */
121
    public function confirmPublication($topicName, $requestId = 1, $publicationId = 1)
122
    {
123
        if (!isset($this->publications[$topicName])) {
124
            throw new \RuntimeException("No publication to topic '$topicName' initiated.");
125
        }
126
127
        $futureResult = $this->publications[$topicName];
128
        $result = new PublishedMessage($requestId, $publicationId);
129
130
        $futureResult->resolve($result);
131
    }
132
133
    /**
134
     * Register.