Passed
Push — master ( 4a454f...b92003 )
by Paul
03:35
created

SiteReviewsFormShortcode::hideOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 8
ccs 7
cts 7
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Shortcodes;
4
5
use GeminiLabs\SiteReviews\Shortcodes\Shortcode;
6
7
class SiteReviewsFormShortcode extends Shortcode
8
{
9 1
	protected function hideOptions() {
10
		return [
11 1
			'rating' => __( 'Hide the rating field', 'site-reviews' ),
12 1
			'title' => __( 'Hide the title field', 'site-reviews' ),
13 1
			'content' => __( 'Hide the review field', 'site-reviews' ),
14 1
			'name' => __( 'Hide the name field', 'site-reviews' ),
15 1
			'email' => __( 'Hide the email field', 'site-reviews' ),
16 1
			'terms' => __( 'Hide the terms field', 'site-reviews' ),
17
		];
18
	}
19
20
	/**
21
	 * @return array
22
	 */
23
	protected function sanitize( array $args )
24
	{
25
		if( empty( $args['id'] )) {
26
			$args['id'] = substr( md5( serialize( $args )), 0, 8 );
27
		}
28
		return $args;
29
	}
30
}
31