Completed
Push — main ( 987b6d...0c8bfc )
by
unknown
04:06
created

ActionRequest::simpleGet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Addwiki\Mediawiki\Api\Client\Action\Request;
4
5
use Addwiki\Mediawiki\Api\Client\Request\StandardRequest;
6
7
class ActionRequest extends StandardRequest implements HasParameterAction {
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: addMultipartParams, addParams, getHeaders, getMethod, getMultipartParams, getParameterEncoding, getParams, getPath, isMultipart, setHeaders, setMethod, setMultipart, setMultipartParams, setParam, setParams, setPath
Loading history...
8
9
	use ParameterActionTrait;
10
11 View Code Duplication
	public static function simpleGet( string $action, array $params = [], array $headers = [] ): self {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
		$req = new self();
13
		$req->setMethod( 'GET' );
14
		$req->setAction( $action );
15
		$req->addParams( $params );
16
		$req->setHeaders( $headers );
17
		return $req;
18
	}
19
20 View Code Duplication
	public static function simplePost( string $action, array $params = [], array $headers = [] ): self {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
		$req = new self();
22
		$req->setMethod( 'POST' );
23
		$req->setAction( $action );
24
		$req->addParams( $params );
25
		$req->setHeaders( $headers );
26
		return $req;
27
	}
28
29
}
30