Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

tagcloud_tags_page_handler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Tagcloud plugin
4
 */
5
6
/**
7
 * Tagcloud init
8
 *
9
 * @return void
10
 */
11
function tagcloud_init() {
12 31
	elgg_extend_view('theme_sandbox/components', 'tagcloud/theme_sandbox/component');
13 31
	elgg_extend_view('elgg.css', 'elgg/tagcloud.css');
14
	
15 31
	elgg_register_page_handler('tags', 'tagcloud_tags_page_handler');
0 ignored issues
show
Deprecated Code introduced by Jeroen Dalsem
The function elgg_register_page_handler() has been deprecated: 3.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

15
	/** @scrutinizer ignore-deprecated */ elgg_register_page_handler('tags', 'tagcloud_tags_page_handler');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
16 31
}
17
18
/**
19
 * Page hander for sitewide tag cloud
20
 *
21
 * @param array $page Page array
22
 *
23
 * @return bool
24
 */
25
function tagcloud_tags_page_handler($page) {
0 ignored issues
show
Unused Code introduced by Jeroen Dalsem
The parameter $page is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
function tagcloud_tags_page_handler(/** @scrutinizer ignore-unused */ $page) {

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

Loading history...
26
	echo elgg_view_resource('tagcloud');
27
	return true;
28
}
29
30
return function() {
31 18
	elgg_register_event_handler('init', 'system', 'tagcloud_init');
32
};
33