Completed
Push — develop ( cff5aa...0a558b )
by Zack
20s queued 11s
created

GravityView_Placeholder_Template   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 20 1
1
<?php
2
/**
3
 * GravityView placeholder templates
4
 *
5
 * @file class-gravityview-placeholder-template.php
6
 * @package   GravityView
7
 * @license   GPL2+
8
 * @author    Katz Web Services, Inc.
9
 * @link      http://gravityview.co
10
 * @copyright Copyright 2021, Katz Web Services, Inc.
11
 *
12
 * @since 2.10
13
 */
14
class GravityView_Placeholder_Template extends GravityView_Template {
15
16
	function __construct( $id = 'template_placeholder', $settings = array() ) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
17
18
		$default_template_settings = array(
19
			'type'        => 'custom',
20
			'buy_source'  => 'https://gravityview.co/pricing/',
21
			'slug'        => '',
22
			'label'       => '',
23
			'description' => '',
24
			'logo'        => '',
25
			'price_id'    => '',
26
			'textdomain'  => '',
27
		);
28
29
		$settings = wp_parse_args( $settings, $default_template_settings );
30
31
		$this->id = $id;
0 ignored issues
show
Bug introduced by
The property id does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
32
		$this->settings = $settings;
33
34
		parent::__construct( $id, $settings, array(), array() );
35
	}
36
37
}
38