Test Failed
Pull Request — master (#2482)
by Devin
05:37
created

Give_Settings_API::get_settings()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 31
rs 8.8571
c 0
b 0
f 0
1
<?php
2
/**
3
 * Give Settings Page/Tab
4
 *
5
 * @package     Give
6
 * @subpackage  Classes/Give_Settings_API
7
 * @copyright   Copyright (c) 2016, WordImpress
8
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
 * @since       1.8
10
 */
11
12
if ( ! defined( 'ABSPATH' ) ) {
13
	exit; // Exit if accessed directly
14
}
15
16
if ( ! class_exists( 'Give_Settings_API' ) ) :
17
18
	/**
19
	 * Give_Settings_API.
20
	 *
21
	 * @sine 1.8
22
	 */
23
	class Give_Settings_API extends Give_Settings_Page {
24
		/**
25
		 * Flag to check if enable saving option for setting page or not
26
		 *
27
		 * @since 1.8.17
28
		 * @var bool
29
		 */
30
		protected $enable_save = false;
31
32
		/**
33
		 * Constructor.
34
		 */
35
		public function __construct() {
36
			$this->id    = 'api';
37
			$this->label = esc_html__( 'API', 'give' );
38
39
			parent::__construct();
40
		}
41
42
		/**
43
		 * Get settings array.
44
		 *
45
		 * @since  1.8
46
		 * @return array
47
		 */
48
		public function get_settings() {
49
			// Get settings.
50
			$settings = apply_filters( 'give_settings_api', array(
51
				array(
52
					'id'   => 'give_tools_api',
53
					'type' => 'title',
54
					'table_html' => false
0 ignored issues
show
introduced by
Each line in an array declaration must end in a comma
Loading history...
55
				),
56
				array(
57
					'id'   => 'api',
58
					'name' => esc_html__( 'API', 'give' ),
59
					'type' => 'api',
60
				),
61
				array(
62
					'id'   => 'give_tools_api',
63
					'type' => 'sectionend',
64
					'table_html' => false
0 ignored issues
show
introduced by
Each line in an array declaration must end in a comma
Loading history...
65
				)
0 ignored issues
show
introduced by
Comma required after last value in array declaration
Loading history...
66
			));
67
68
			/**
69
			 * Filter the settings.
70
			 *
71
			 * @since  1.8
72
			 * @param  array $settings
73
			 */
74
			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
75
76
			// Output.
77
			return $settings;
78
		}
79
	}
80
81
endif;
82
83
return new Give_Settings_API();
84