Completed
Push — master ( 15db70...750821 )
by Dennis
01:29
created

Label::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace lloc\Msls\Component\Input;
4
5
use lloc\Msls\Component\InputInterface;
6
7
/**
8
 * Class Label
9
 * @package lloc\Msls\Component\Input
10
 */
11
class Label implements InputInterface {
12
13
	/**
14
	 * @var string
15
	 */
16
	protected $key;
17
18
	/**
19
	 * @var string
20
	 */
21
	protected $text;
22
23
	/**
24
	 * @param string $key
25
	 * @param string $label
0 ignored issues
show
Bug introduced by
There is no parameter named $label. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
26
	 */
27
	public function __construct( string $key, string $text ) {
28
		$this->key   = esc_attr( $key );
29
		$this->text = esc_html( $text );
30
	}
31
32
	/**
33
	 * @return string
34
	 */
35
	public function render(): string {
36
		return sprintf( '<label for="%1$s">%2$s</label>', $this->key, $this->text );
37
	}
38
39
}