Code Duplication    Length = 20-24 lines in 2 locations

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

@@ 101-120 (lines=20) @@
98
     * @throws NotFoundException
99
     * @throws ConflictException
100
     */
101
    public function playMedia($id, $media, $lang = null, $offsetms = null, $skipms = null, $playbackId = null)
102
    {
103
        $uri = "{$this->getType()}/$id/play";
104
105
        try {
106
            $response = $this->client->getEndpoint()->post($uri, [
107
                'form_params' => [
108
                    'media' => $media,
109
                    'lang' => $lang,
110
                    'offsetms' => $offsetms,
111
                    'skipms' => $skipms,
112
                    'playbackId' => $playbackId,
113
                ]
114
            ]);
115
        } catch (RequestException $e) {
116
            $this->processRequestException($e);
117
        }
118
119
        return new Playback($this->client, \GuzzleHttp\json_decode($response->getBody()));
120
    }
121
122
    /**
123
     * Start playback of media and specify the playbackId. The media URI may be any of a number of URI's.
@@ 139-162 (lines=24) @@
136
     * @throws NotFoundException
137
     * @throws ConflictException
138
     */
139
    public function playMediaWithId(
140
        $id,
141
        $media,
142
        $lang = null,
143
        $offsetms = null,
144
        $skipms = null,
145
        $playbackId = null
146
    ) {
147
        $uri = "{$this->getType()}/$id/play/$playbackId";
148
        try {
149
            $response = $this->client->getEndpoint()->post($uri, [
150
                'form_params' => [
151
                    'media' => $media,
152
                    'lang' => $lang,
153
                    'offsetms' => $offsetms,
154
                    'skipms' => $skipms,
155
                ]
156
            ]);
157
        } catch (RequestException $e) {
158
            $this->processRequestException($e);
159
        }
160
161
        return new Playback($this->client, \GuzzleHttp\json_decode($response->getBody()));
162
    }
163
164
    /**
165
     * Start a recording. Record audio from a channel. Note that this will not capture audio sent to the