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 ( fa35e8...bb810f )
by Brad
02:38
created

FooGallery_Simple_Portfolio_Gallery_Template   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 80
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A register_myself() 0 4 1
A add_template() 0 53 1
1
<?php
2
3
if ( !class_exists( 'FooGallery_Simple_Portfolio_Gallery_Template' ) ) {
4
5
	define('FOOGALLERY_SIMPLE_PORTFOLIO_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
6
7
	class FooGallery_Simple_Portfolio_Gallery_Template {
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...
8
		/**
9
		 * Wire up everything we need to run the extension
10
		 */
11
		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...
12
			add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
13
			add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
14
		}
15
16
		/**
17
		 * Register myself so that all associated JS and CSS files can be found and automatically included
18
		 * @param $extensions
19
		 *
20
		 * @return array
21
		 */
22
		function register_myself( $extensions ) {
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...
23
			$extensions[] = __FILE__;
24
			return $extensions;
25
		}
26
27
		/**
28
		 * Add our gallery template to the list of templates available for every gallery
29
		 * @param $gallery_templates
30
		 *
31
		 * @return array
32
		 */
33
		function add_template( $gallery_templates ) {
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...
34
35
			$gallery_templates[] = array(
36
					'slug'        => 'simple_portfolio',
37
					'name'        => __( 'Simple Portfolio', 'foogallery' ),
38
					'fields'	  => array(
39
							array(
40
									'id'	  => 'help',
41
									'title'	  => __( 'Tip', 'foogallery' ),
42
									'type'	  => 'html',
43
									'help'	  => true,
44
									'desc'	  => __( 'The Simple Portfolio template works best when you have <strong>captions and descriptions</strong> set for every attachment in the gallery.<br />To change captions and descriptions, simply hover over the thumbnail above and click the "i" icon.', 'foogallery' ),
45
							),
46
							array(
47
									'id'      => 'thumbnail_dimensions',
48
									'title'   => __( 'Thumbnail Size', 'foogallery' ),
49
									'desc'    => __( 'Choose the size of your thumbnails.', 'foogallery' ),
50
									'type'    => 'thumb_size',
51
									'default' => array(
52
											'width' => 250,
53
											'height' => 200,
54
											'crop' => true,
55
									),
56
							),
57
							array(
58
									'id'      => 'thumbnail_link',
59
									'title'   => __( 'Thumbnail Link', 'foogallery' ),
60
									'default' => 'image',
61
									'type'    => 'thumb_link',
62
									'spacer'  => '<span class="spacer"></span>',
63
									'desc'	  => __( 'You can choose to link each thumbnail to the full size image, or to the image\'s attachment page, or you can choose to not link to anything.', 'foogallery' )
64
							),
65
							array(
66
									'id'      => 'lightbox',
67
									'title'   => __( 'Lightbox', 'foogallery' ),
68
									'desc'    => __( 'Choose which lightbox you want to display images with. The lightbox will only work if you set the thumbnail link to "Full Size Image".', 'foogallery' ),
69
									'type'    => 'lightbox',
70
							),
71
							array(
72
									'id'      => 'gutter',
73
									'title'   => __( 'Gutter', 'foogallery' ),
74
									'desc'    => __( 'The spacing between each thumbnail in the gallery.', 'foogallery' ),
75
									'type'    => 'number',
76
									'class'   => 'small-text',
77
									'default' => 40,
78
									'step'    => '1',
79
									'min'     => '0',
80
							)
81
					),
82
			);
83
84
			return $gallery_templates;
85
		}
86
	}
87
}