Passed
Push — master ( f13f78...5c1b24 )
by Ismayil
04:22
created

docs/examples/hooks/basic.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * The handler for a plugin hook receives information about the hook (name and
4
 * type), the current value for the hook, and parameters related to the hook.
5
 */
6
7
elgg_register_plugin_hook_handler('forward', '404', 'example_plugin_hook_handler');
8
9
function example_plugin_hook_handler($hook, $type, $value, $params) {
0 ignored issues
show
The function example_plugin_hook_handler() has been defined more than once; this definition is ignored, only the first definition in docs/examples/hooks/advanced.php (L12-17) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
10
	var_dump($hook);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($hook); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
11
	var_dump($type);
12
	var_dump($value);
13
	var_dump($params);
14
15
	// we are not changing $value so return null
16
	return null;
17
}
18