Completed
Push — main ( 2daa48...b5d932 )
by
unknown
08:38
created

AnonymousGenerator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 29
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Addwiki\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
	private string $name;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
15
16
	private array $params = [];
17
18
	/**
19
	 * @param array $params including 'g' prefix keys
20
	 */
21
	public function __construct( string $name, array $params = [] ) {
22
		$this->name = $name;
23
		$this->params = $params;
24
	}
25
26
	/**
27
	 * @return array
28
	 */
29
	public function getParams(): array {
30
		$this->params['generator'] = $this->name;
31
		return $this->params;
32
	}
33
}
34