Code Duplication    Length = 11-11 lines in 2 locations

src/MediawikiApi.php 2 locations

@@ 182-192 (lines=11) @@
179
	 *         Normally promising an array, though can be mixed (json_decode result)
180
	 *         Can throw UsageExceptions or RejectionExceptions
181
	 */
182
	public function getRequestAsync( Request $request ) {
183
		$promise = $this->getClient()->requestAsync(
184
			'GET',
185
			$this->apiUrl,
186
			$this->getClientRequestOptions( $request, 'query' )
187
		);
188
189
		return $promise->then( function ( ResponseInterface $response ) {
190
			return call_user_func( [ $this, 'decodeResponse' ], $response );
191
		} );
192
	}
193
194
	/**
195
	 * @since 2.0
@@ 203-213 (lines=11) @@
200
	 *         Normally promising an array, though can be mixed (json_decode result)
201
	 *         Can throw UsageExceptions or RejectionExceptions
202
	 */
203
	public function postRequestAsync( Request $request ) {
204
		$promise = $this->getClient()->requestAsync(
205
			'POST',
206
			$this->apiUrl,
207
			$this->getClientRequestOptions( $request, $this->getPostRequestEncoding( $request ) )
208
		);
209
210
		return $promise->then( function ( ResponseInterface $response ) {
211
			return call_user_func( [ $this, 'decodeResponse' ], $response );
212
		} );
213
	}
214
215
	/**
216
	 * @since 0.2