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.

FooGallery_Animated_Gif_Support   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A support_for_animations() 0 12 5
1
<?php
2
/**
3
 * Animated GIF support in FooGallery
4
 * Date: 19/02/2017
5
 */
6
if ( ! class_exists( 'class-foogallery-animated-gif-support.php' ) ) {
7
8
	class FooGallery_Animated_Gif_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...
9
10
		/**
11
		 * FooGallery_Animated_Gif_Support constructor.
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_thumbnail_resize_args', array( $this, 'support_for_animations' ), 10, 3 );
15
		}
16
17
		/**
18
		 * Checks if the thumb we are using is an animated GIF. If so, return the original image so that the thumb is also animated
19
		 *
20
		 * @param array $args
21
		 * @param string $original_image_src
22
		 * @param FooGalleryAttachment $thumbnail_object
23
		 *
24
		 * @return array
25
		 */
26
		function support_for_animations( $args, $original_image_src, $thumbnail_object ) {
0 ignored issues
show
Unused Code introduced by
The parameter $thumbnail_object 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...
27
			$filetype = wp_check_filetype( $original_image_src );
28
29
			if ( is_array( $filetype ) && array_key_exists( 'ext', $filetype ) && 'gif' === $filetype['ext'] ) {
30
31
				if ( 'on' === foogallery_get_setting( 'animated_gif_use_original_image' ) ) {
32
					$args['force_use_original_image'] = true;
33
				}
34
			}
35
36
			return $args;
37
		}
38
	}
39
}