Completed
Push — master ( ec2f81...11966d )
by adam
03:28
created

AnonymousGenerator::getParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Mediawiki\Api\Generator;
4
5
/**
6
 * @access public
7
 *
8
 * @author Addshore
9
 *
10
 * @since 0.5.1
11
 */
12
class AnonymousGenerator implements ApiGenerator {
13
14
	/**
15
	 * @var string
16
	 */
17
	private $name;
18
19
	/**
20
	 * @var array
21
	 */
22
	private $params;
23
24
	/**
25
	 * @param string $name
26
	 * @param array $params including 'g' prefix keys
27
	 */
28 1
	public function __construct( $name, array $params ) {
29 1
		$this->name = $name;
30 1
		$this->params = $params;
31 1
	}
32
33
	/**
34
	 * @return array
35
	 */
36 1
	public function getParams() {
37 1
		$params = $this->params;
38 1
		$params['generator'] = $this->name;
39 1
		return $params;
40
	}
41
}
42