LSX_Customizer_Core::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 1
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
2
if ( ! class_exists( 'LSX_Customizer_Core' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
3
4
	/**
5
	 * LSX Customizer Core Class
6
	 *
7
	 * @package   LSX Customizer
8
	 * @author    LightSpeed
9
	 * @license   GPL3
10
	 * @link
11
	 * @copyright 2016 LightSpeed
12
	 */
13
	class LSX_Customizer_Core extends LSX_Customizer {
14
15
		/**
16
		 * Constructor.
17
		 *
18
		 * @since 1.0.0
19
		 */
20
		public function __construct() {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
21
			add_action( 'customize_register', array( $this, 'customize_register' ), 20 );
22
		}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
23
24
		/**
25
		 * Customizer Controls and Settings.
26
		 *
27
		 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
28
		 * @since 1.0.0
29
		 */
30
		public function customize_register( $wp_customize ) {
31
			/**
32
			 * Core section: Theme Credit
33
			 */
34
			$wp_customize->add_setting( 'lsx_theme_credit_status', array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
For multi-line function calls, each argument should be on a separate line.

For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
);
Loading history...
35
				'default'           => true,
36
				'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
37
			) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
38
39
			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_theme_credit_status', array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
For multi-line function calls, each argument should be on a separate line.

For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
);
Loading history...
40
				'label'         => esc_html__( 'Theme Credit', 'lsx-customizer' ),
0 ignored issues
show
introduced by
Array double arrow not aligned correctly; expected 4 space(s) between "'label'" and double arrow, but found 9.
Loading history...
41
				// 'description'   => esc_html__( 'Displays theme credit in footer.', 'lsx-customizer' ),
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
42
				'section'       => 'lsx-layout',
0 ignored issues
show
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'section'" and double arrow, but found 7.
Loading history...
43
				'settings'      => 'lsx_theme_credit_status',
0 ignored issues
show
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'settings'" and double arrow, but found 6.
Loading history...
44
				'type'          => 'checkbox',
0 ignored issues
show
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'type'" and double arrow, but found 10.
Loading history...
45
				'priority'      => 10,
0 ignored issues
show
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'priority'" and double arrow, but found 6.
Loading history...
46
			) ) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
47
		}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
48
49
	}
50
51
	new LSX_Customizer_Core();
52
0 ignored issues
show
Coding Style introduced by
Blank line found at end of control structure
Loading history...
53
}
54