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/demo-content ( 34d331 )
by Brad
02:59
created

FooGallery_Demo_Content_Generator::add_menu()   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
2
/**
3
 * Created by Brad Vincent.
4
 * Date: 04/03/2018
5
 */
6
if ( ! class_exists( 'FooGallery_Demo_Content_Generator' ) ) {
7
8
	class FooGallery_Demo_Content_Generator {
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
		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...
10
			//always show the menu
11
			add_action( 'foogallery_admin_menu_after', array( $this, 'add_menu' ) );
12
			add_action( 'foogallery_extension_activated-demo-content', array( $this, 'add_menu' ) );
13
		}
14
15
		function add_menu() {
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...
16
			foogallery_add_submenu_page( __( 'Demo Content', 'foogallery' ), 'manage_options', 'foogallery-demo-content', array(
17
				$this,
18
				'render_view',
19
			) );
20
		}
21
22
		function render_view() {
23
			require_once 'view-demo-content.php';
24
		}
25
26
		static function generate( $query ) {
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...
27
			require_once 'includes/class-pixabay.php';
28
29
			$client = new FooGallery_PixabayClient();
30
			$key = apply_filters( 'foogallery_pixabay_key', '1843003-12be68cf2726df47797f19cd7' );
31
32
			$results = $client->search( $key, $query );
33
34
			$hits = $results->hits;
35
36
			return 'found ' . count($hits);
37
		}
38
	}
39
}