Completed
Push — master ( ddde46...ec2f81 )
by adam
12:43 queued 09:38
created

AnonymousGenerator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 2
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
	public function __construct( $name, array $params ) {
29
		$this->name = $name;
30
		$this->params = $params;
31
	}
32
33
	/**
34
	 * @return array
35
	 */
36
	public function getParams() {
37
		$params = $this->params;
38
		$params['generator'] = $this->name;
39
		return $params;
40
	}
41
}
42