Passed
Push — master ( 6b8ca8...3384db )
by Paul
04:57
created

SiteReviewsFormShortcode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 15
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A sanitize() 0 6 2
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Shortcodes;
4
5
use GeminiLabs\SiteReviews\Shortcodes\Shortcode;
6
7
class SiteReviewsFormShortcode extends Shortcode
8
{
9
	protected $hiddenKeys = [
10
		'email', 'name', 'terms', 'title',
11
	];
12
13
	/**
14
	 * @return array
15
	 */
16
	protected function sanitize( array $args )
17
	{
18
		if( empty( $args['id'] )) {
19
			$args['id'] = substr( md5( serialize( $args )), 0, 8 );
20
		}
21
		return $args;
22
	}
23
}
24