Code Duplication    Length = 20-24 lines in 2 locations

src/wormling/phparia/Api/MediaBase.php 2 locations

@@ 106-125 (lines=20) @@
103
     * @throws NotFoundException
104
     * @throws ConflictException
105
     */
106
    public function playMedia($id, $media, $lang = null, $offsetms = null, $skipms = null, $playbackId = null)
107
    {
108
        $uri = "/{$this->getType()}/$id/play";
109
110
        try {
111
            $response = $this->client->getEndpoint()->post($uri, array(
112
                'media' => $media,
113
                'lang' => $lang,
114
                'offsetms' => $offsetms,
115
                'skipms' => $skipms,
116
                'playbackId' => $playbackId,
117
            ));
118
        } catch (Pest_NotFound $e) {
119
            throw new NotFoundException($e);
120
        } catch (Pest_Conflict $e) {
121
            throw new ConflictException($e);
122
        }
123
124
        return new Playback($this->client, $response);
125
    }
126
127
    /**
128
     * Start playback of media and specify the playbackId. The media URI may be any of a number of URI's.
@@ 144-167 (lines=24) @@
141
     * @throws NotFoundException
142
     * @throws ConflictException
143
     */
144
    public function playMediaWithId(
145
        $id,
146
        $media,
147
        $lang = null,
148
        $offsetms = null,
149
        $skipms = null,
150
        $playbackId = null
151
    ) {
152
        $uri = "/{$this->getType()}/$id/play/$playbackId";
153
        try {
154
            $response = $this->client->getEndpoint()->post($uri, array(
155
                'media' => $media,
156
                'lang' => $lang,
157
                'offsetms' => $offsetms,
158
                'skipms' => $skipms,
159
            ));
160
        } catch (Pest_NotFound $e) {
161
            throw new NotFoundException($e);
162
        } catch (Pest_Conflict $e) {
163
            throw new ConflictException($e);
164
        }
165
166
        return new Playback($this->client, $response);
167
    }
168
169
    /**
170
     * Start a recording. Record audio from a channel. Note that this will not capture audio sent to the