Issues (1724)

classes/class-lsx-customizer-admin.php (20 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
if ( ! class_exists( 'LSX_Customizer_Admin' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
3
4
	/**
5
	 * LSX Customizer Admin Class
6
	 *
7
	 * @package   LSX Customizer
8
	 * @author    LightSpeed
9
	 * @license   GPL3
10
	 * @link
11
	 * @copyright 2016 LightSpeed
12
	 */
13
	class LSX_Customizer_Admin extends LSX_Customizer {
14
15
		/**
16
		 * Constructor.
17
		 *
18
		 * @since 1.0.0
19
		 */
20
		public function __construct() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
21
			add_action( 'customize_preview_init', array( $this, 'assets' ), 9999 );
22
			add_action( 'customize_controls_enqueue_scripts', array( $this, 'assets_wysiwyg_editor' ), 9999 );
23
24
			if ( is_admin() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
25
				add_filter( 'lsx_customizer_colour_selectors_body', array( $this, 'customizer_body_colours_handler' ), 15, 2 );
26
			}
27
		}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
28
29
		/**
30
		 * Enques the assets.
31
		 *
32
		 * @since 1.0.0
33
		 */
34
		public function assets() {
35
			wp_enqueue_script( 'lsx_customizer_admin', LSX_CUSTOMIZER_URL . 'assets/js/lsx-customizer-admin.min.js', array( 'jquery' ), LSX_CUSTOMIZER_VER, true );
36
37
			$params = apply_filters( 'lsx_customizer_admin_js_params', array(
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
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...
38
				'ajax_url' => admin_url( 'admin-ajax.php' ),
39
			));
0 ignored issues
show
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...
40
41
			wp_localize_script( 'lsx_customizer_admin', 'lsx_customizer_params', $params );
42
43
			wp_enqueue_style( 'lsx_customizer_admin', LSX_CUSTOMIZER_URL . 'assets/css/lsx-customizer-admin.css', array(), LSX_CUSTOMIZER_VER );
44
		}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
45
46
		/**
47
		 * Enques the assets for editor.
48
		 *
49
		 * @since 1.1.1
50
		 */
51
		public function assets_wysiwyg_editor() {
52
			wp_enqueue_script( 'lsx_customizer_editor', LSX_CUSTOMIZER_URL . 'assets/js/lsx-customizer-editor.min.js', array( 'jquery' ), LSX_CUSTOMIZER_VER, true );
53
		}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
54
55
		/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$css" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$colors" missing
Loading history...
56
		 * Handle body colours that might be change by LSX Customizer.
57
		 */
58
		public function customizer_body_colours_handler( $css, $colors ) {
59
			$css .= '
60
				@import "' . LSX_CUSTOMIZER_PATH . '/assets/css/scss/customizer-customizer-body-colours";
61
62
				/**
63
				 * LSX Customizer - Body (LSX Customizer)
64
				 */
65
				@include customizer-customizer-body-colours (
66
					$bg:   		' . $colors['background_color'] . ',
67
					$breaker:   ' . $colors['body_line_color'] . ',
68
					$color:    	' . $colors['body_text_color'] . ',
69
					$link:    	' . $colors['body_link_color'] . ',
70
					$hover:    	' . $colors['body_link_hover_color'] . ',
71
					$small:    	' . $colors['body_text_small_color'] . ',
72
				);
73
			';
74
75
			return $css;
76
		}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
77
78
	}
79
80
	new LSX_Customizer_Admin();
81
0 ignored issues
show
Blank line found at end of control structure
Loading history...
82
}
83