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 — feature/gallery-template-clien... ( be3a46...9fa9ce )
by Brad
02:28
created

FooGallery_Pro_Default_Templates::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 7 and the first side effect is on line 13.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * FooGallery Pro Default Templates Class
4
 */
5
if ( ! class_exists( 'FooGallery_Pro_Default_Templates' ) ) {
6
7
	define( 'FOOGALLERY_PRO_DEFAULT_TEMPLATES_URL', plugin_dir_url( __FILE__ ) );
8
	define( 'FOOGALLERY_PRO_DEFAULT_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) );
9
10
	define( 'FOOGALLERY_PRO_DEFAULT_TEMPLATES_SHARED_URL', FOOGALLERY_PRO_DEFAULT_TEMPLATES_URL . 'shared/' );
11
	define( 'FOOGALLERY_PRO_DEFAULT_TEMPLATES_SHARED_PATH', FOOGALLERY_PRO_DEFAULT_TEMPLATES_PATH . 'shared/' );
12
13
	require_once( FOOGALLERY_PRO_DEFAULT_TEMPLATES_PATH . 'polaroid/class-polaroid-gallery-template.php' );
14
15
	class FooGallery_Pro_Default_Templates {
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...
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
			new FooGallery_Polaroid_Gallery_Template();
19
20
			add_filter( 'foogallery_core_gallery_style', array( $this, 'pro_core_gallery_style' ) );
21
			add_filter( 'foogallery_core_gallery_script', array( $this, 'pro_core_gallery_script' ) );
22
		}
23
24
		/***
25
		 * Return the path to the PRO core gallery stylesheet
26
		 */
27
		function pro_core_gallery_style( $url ){
0 ignored issues
show
Unused Code introduced by
The parameter $url 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...
28
			$filename = foogallery_get_setting( 'enable_debugging', false ) ? '' : '.min';
29
			return FOOGALLERY_PRO_DEFAULT_TEMPLATES_SHARED_URL . 'css/foogallery' . $filename . '.css';
30
		}
31
32
		/***
33
		 * Return the path to the PRO core gallery script
34
		 */
35
		function pro_core_gallery_script( $url ){
0 ignored issues
show
Unused Code introduced by
The parameter $url 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...
36
			$filename = foogallery_get_setting( 'enable_debugging', false ) ? '' : '.min';
37
			return FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'js/foogallery' . $filename . '.js';
38
		}
39
	}
40
}
41