Passed
Push — master ( d8e403...d1c323 )
by Paul
05:05
created

Honeypot::required()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Modules\Html\Fields;
4
5
use GeminiLabs\SiteReviews\Modules\Html\Fields\Field;
6
7
class Honeypot extends Field
8
{
9
	/**
10
	 * @return string|void
11
	 */
12
	public function build()
13
	{
14
		$this->builder->args = wp_parse_args( $this->builder->args, [
15
			'name' => $this->builder->args['text'],
16
		]);
17
		$this->mergeFieldArgs();
18
		$this->builder->tag = 'input';
19
		return $this->builder->getOpeningTag();
20
	}
21
22
	/**
23
	 * @return array
24
	 */
25
	public static function required()
26
	{
27
		return [
28
			'autocomplete' => 'off',
29
			'style' => 'display:none!important',
30
			'tabindex' => '-1',
31
			'type' => 'text',
32
		];
33
	}
34
}
35