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 ( 36ac04...f6214d )
by Brad
02:18
created

FooGallery_Responsive_Lightbox_dFactory_Support   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 39
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A add_lightbox() 0 4 1
A add_lightbox_data_rel() 0 9 2
1
<?php
2
/**
3
 * Builds in support for the Responsive Lightbox plugin by dFactory
4
 * Created by brad.
5
 * Date: 13/05/2017
6
 *
7
 * @since 1.2.21
8
 */
9
if ( ! class_exists( 'FooGallery_Responsive_Lightbox_dFactory_Support' ) ) {
10
11
	class FooGallery_Responsive_Lightbox_dFactory_Support {
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...
12
13
		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...
14
			add_filter( 'foogallery_gallery_template_field_lightboxes', array( $this, 'add_lightbox' ), 99 );
15
			add_filter( 'foogallery_attachment_html_link_attributes', array( $this, 'add_lightbox_data_rel' ), 10, 3 );
16
		}
17
18
		/**
19
		 * Add the dFactory lightbox to the available FooGallery lightboxes
20
		 * @param $lightboxes
21
		 *
22
		 * @return mixed
23
		 * @since 1.2.21
24
		 */
25
		function add_lightbox($lightboxes) {
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...
26
			$lightboxes['dfactory'] = __( 'Responsive Lightbox by dFactory', 'foogallery' );
27
			return $lightboxes;
28
		}
29
30
		/**
31
		 * If the dFactory lightbox is selected for the gallery, then make the integration work
32
		 *
33
		 * @param $attr
34
		 * @param $args
35
		 * @param $attachment
36
		 *
37
		 * @return mixed
38
		 * @since 1.2.21
39
		 */
40
		function add_lightbox_data_rel($attr, $args, $attachment) {
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $attachment is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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...
41
			$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
42
43
			if ( 'dfactory' === $lightbox ) {
44
				$attr['data-rel'] = 'lightbox';
45
			}
46
47
    		return $attr;
48
		}
49
	}
50
}