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
Pull Request — develop (#47)
by Chris
02:43 queued 01:12
created

namespace.php ➔ render_add_all_games()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 1
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Games Collector Gutenberg Integration
4
 *
5
 * @package GC\GamesCollector\Gutenberg
6
 * @since   1.3.0
7
 */
8
9
namespace GC\GamesCollector\Gutenberg;
10
11
use GC\GamesCollector\Shortcode;
12
13
/**
14
 * Enqueue the Gutenberg editor js and css.
15
 */
16
function enqueue_block_editor_assets() {
17
	$js_file = plugin_dir_url( dirname( __FILE__, 2 ) ) . 'assets/js/editor.js';
18
	wp_enqueue_script( 'games-collector-gberg-editor', $js_file, [ 'wp-i18n', 'wp-blocks', 'wp-element' ], '1.3.0' );
19
	wp_enqueue_style( 'games-collector-gberg-editor', dirname( plugin_dir_url( __FILE__ ), 2 ) . '/assets/css/editor.css', [ 'wp-blocks' ], '1.3.0' );
20
	wp_enqueue_style( 'games-collector', dirname( plugin_dir_url( __FILE__ ), 2 ) . '/assets/css/main.css', [], '1.3.0' );
21
}
22
23
/**
24
 * Register the Games Collector Gutenberg blocks.
25
 */
26
function register_blocks() {
27
	// Bail if not using Gutenberg.
28
	if ( ! function_exists( 'register_block_type' ) ) {
29
		return;
30
	}
31
32
	register_block_type( 'games-collector/add-all-games', [
33
		'render_callback' => __NAMESPACE__ . '\\render_add_all_games',
34
	] );
35
}
36
37
/**
38
 * Piggyback off the shortcode for rendering the games list.
39
 *
40
 * @return string HTML for the games list.
41
 */
42
function render_add_all_games() {
43
	return Shortcode\render_games();
44
}
45