GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( c721e5...0f0dc5 )
by Brad
03:00
created

FooGallery_Admin_Gallery_MetaBox_Settings   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 13
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A enqueue_assets() 0 12 4
B add_section_icons() 0 19 8
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: bradvin
5
 * Date: 2017/04/19
6
 * Time: 1:19 PM
7
 */
8
9
10
if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBox_Settings' ) ) {
11
12
    class FooGallery_Admin_Gallery_MetaBox_Settings {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
13
14
        /**
15
         * FooGallery_Admin_Gallery_MetaBox_Settings constructor.
16
         */
17
        function __construct() {
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...
18
            //enqueue assets for the new settings tabs
19
            add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
20
21
            //set default settings tab icons
22
            add_filter( 'foogallery_gallery_settings_metabox_section_icon', array( $this, 'add_section_icons') );
23
        }
24
25
        /***
26
         * Enqueue the assets needed by the settings
27
         * @param $hook_suffix
28
         */
29
        function enqueue_assets( $hook_suffix ){
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...
30
            if( in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ) {
31
                $screen = get_current_screen();
32
33
                if ( is_object( $screen ) && FOOGALLERY_CPT_GALLERY == $screen->post_type ){
34
35
                    // Register, enqueue scripts and styles here
36
                    wp_enqueue_script( 'foogallery-admin-settings', FOOGALLERY_URL . '/js/foogallery.admin.min.js', array('jquery'), FOOGALLERY_VERSION );
37
                    wp_enqueue_style( 'foogallery-admin-settings', FOOGALLERY_URL . '/css/foogallery.admin.min.css', array(), FOOGALLERY_VERSION );
38
                }
39
            }
40
        }
41
42
        /**
43
         * Returns the Dashicon that can be used in the settings tabs
44
         * @param $section_slug
45
         * @return string
46
         */
47
        function add_section_icons( $section_slug ) {
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...
48
            switch ( $section_slug ) {
49
                case 'general':
50
                    return 'dashicons-format-image';
51
                case 'advanced':
52
                    return 'dashicons-admin-generic';
53
                case 'appearance':
54
                    return 'dashicons-admin-appearance';
55
                case 'video':
56
                    return 'dashicons-format-video';
57
				case 'hover effects':
58
					return 'dashicons-admin-tools';
59
				case 'captions':
60
					return 'dashicons-testimonial';
61
                case 'paging':
62
                    return 'dashicons-admin-page';
63
            }
64
            return 'dashicons-admin-tools';
65
        }
66
    }
67
}