chemiker/e.nigma-2015

View on GitHub
src/theme/functions/customizer.php

Summary

Maintainability
A
1 hr
Test Coverage

Method register has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public static function register($wp_customize){

            $wp_customize->add_setting('enigma_2015_header_link_color', array(
                'default' => 'FAFAFA',
                'type' => 'theme_mod',
Severity: Minor
Found in src/theme/functions/customizer.php - About 1 hr to fix

    Spaces must be used for alignment; tabs are not allowed
    Open

                $wp_customize->add_control( 'enigma_2015_information_about', array(

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'priority' => 120,

    Spaces must be used for alignment; tabs are not allowed
    Open

                ));

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'settings' => 'enigma_2015_information_image',

    The closing brace for the class must go on the next line after the body
    Open

        }

    Spaces must be used for alignment; tabs are not allowed
    Open

                ) ) );

    Spaces must be used for alignment; tabs are not allowed
    Open

                $wp_customize->add_setting('enigma_2015_information_about', array(

    Spaces must be used for alignment; tabs are not allowed
    Open

                ));

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'title' => __('Information', 'e.nigma-2015'),

    Spaces must be used for alignment; tabs are not allowed
    Open

                ));

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'default' => __('Welcome to my blog', 'e.nigma-2015'),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'type' => 'theme_mod',

    Spaces must be used for alignment; tabs are not allowed
    Open

                ));

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'description' => __('Displays a small about section in the footer of your blog.', 'e.nigma-2015'),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'label' => __('About', 'e.nigma-2015'),

    Spaces must be used for alignment; tabs are not allowed
    Open

        }

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'settings' => 'enigma_2015_information_about'

    Spaces must be used for alignment; tabs are not allowed
    Open

                ) ) );

    Spaces must be used for alignment; tabs are not allowed
    Open

                     'sanitize_callback' => function ($text) { return $text; }

    Spaces must be used for alignment; tabs are not allowed
    Open

                $wp_customize->add_setting('enigma_2015_information_image', array(

    Spaces must be used for alignment; tabs are not allowed
    Open

                            'label' => __( 'Header Link Color', 'e.nigma-2015' ),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'type' => 'textarea',

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'default' =>  get_template_directory_uri().'/screenshot.png',

    Spaces must be used for alignment; tabs are not allowed
    Open

                            'settings' => 'enigma_2015_header_link_color',

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'label'    => __('Image', 'e.nigma-2015'),

    Spaces must be used for alignment; tabs are not allowed
    Open

                $wp_customize->add_control(    new \WP_Customize_Color_Control($wp_customize, 'enigma_2015_header_link_color', array(

    Spaces must be used for alignment; tabs are not allowed
    Open

                            'section' => 'colors',

    Spaces must be used for alignment; tabs are not allowed
    Open

                $wp_customize->add_section('enigma_2015_information', array(

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'section' => 'enigma_2015_information',

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'type' => 'theme_mod',

    Spaces must be used for alignment; tabs are not allowed
    Open

                $wp_customize->add_control( new \WP_Customize_Image_Control($wp_customize, 'image', array(

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'section'  => 'enigma_2015_information',

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'sanitize_callback' => 'esc_url_raw'

    Opening brace of a class must be on the line after the definition
    Open

        class Customizer {

    Spaces must be used for alignment; tabs are not allowed
    Open

            }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'type' => 'theme_mod',

    Spaces must be used to indent lines; tabs are not allowed
    Open

                ));

    Spaces must be used to indent lines; tabs are not allowed
    Open

            public static function register($wp_customize){

    Spaces must be used to indent lines; tabs are not allowed
    Open

                     'sanitize_js_callback' => 'maybe_hash_hex_color',

    Spaces must be used to indent lines; tabs are not allowed
    Open

        namespace enigma;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'default' => 'FAFAFA',

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $wp_customize->add_control(    new \WP_Customize_Color_Control($wp_customize, 'enigma_2015_header_link_color', array(

    Spaces must be used to indent lines; tabs are not allowed
    Open

                     'sanitize_callback'    => array( 'WP_Customize_Manager', '_sanitize_header_textcolor' ),

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $wp_customize->add_setting('enigma_2015_header_link_color', array(

    Spaces must be used to indent lines; tabs are not allowed
    Open

        class Customizer {

    Line exceeds 120 characters; contains 126 characters
    Open

                $wp_customize->add_control(    new \WP_Customize_Color_Control($wp_customize, 'enigma_2015_header_link_color', array(

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        }

    Opening brace should be on a new line
    Open

            public static function register($wp_customize){

    Opening brace must be the last content on the line
    Open

                     'sanitize_callback' => function ($text) { return $text; }

    Space after opening parenthesis of function call prohibited
    Open

                $wp_customize->add_control( new \WP_Customize_Image_Control($wp_customize, 'image', array(

    Space after opening parenthesis of function call prohibited
    Open

                $wp_customize->add_control(    new \WP_Customize_Color_Control($wp_customize, 'enigma_2015_header_link_color', array(

    Expected 0 spaces before closing bracket; 1 found
    Open

                            'label' => __( 'Header Link Color', 'e.nigma-2015' ),

    Line indented incorrectly; expected 4 spaces, found 8
    Open

            }

    Expected 0 spaces before closing bracket; 1 found
    Open

                $wp_customize->add_control(    new \WP_Customize_Color_Control($wp_customize, 'enigma_2015_header_link_color', array(

    Expected 0 spaces before closing bracket; 1 found
    Open

                $wp_customize->add_control( new \WP_Customize_Image_Control($wp_customize, 'image', array(

    Space after opening parenthesis of function call prohibited
    Open

                $wp_customize->add_control( 'enigma_2015_information_about', array(

    Expected 0 spaces before closing bracket; 1 found
    Open

                $wp_customize->add_control( new \WP_Customize_Image_Control($wp_customize, 'image', array(

    Expected 0 spaces before closing bracket; 1 found
    Open

                $wp_customize->add_control(    new \WP_Customize_Color_Control($wp_customize, 'enigma_2015_header_link_color', array(

    Space after opening parenthesis of function call prohibited
    Open

                            'label' => __( 'Header Link Color', 'e.nigma-2015' ),

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        class Customizer {

    Closing brace must be on a line by itself
    Open

                     'sanitize_callback' => function ($text) { return $text; }

    Line indented incorrectly; expected 4 spaces, found 8
    Open

            public static function register($wp_customize){

    There are no issues that match your filters.

    Category
    Status