Completed
Pull Request — develop (#1436)
by
unknown
15:35
created

GravityView_Placeholder_Template::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
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