Passed
Branch master (70a077)
by Tim
02:25
created

hook_frontpage.php ➔ monitor_hook_frontpage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Hook to add the themejustitie module to the frontpage.
4
 *
5
 * @param array &$links  The links on the frontpage, split into sections.
6
 */
7
8
function monitor_hook_frontpage(&$links)
9
{
10
        assert(is_array($links));
0 ignored issues
show
Bug introduced by
The call to assert() has too few arguments starting with description. ( Ignorable by Annotation )

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

10
        /** @scrutinizer ignore-call */ 
11
        assert(is_array($links));

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
11
        assert(array_key_exists('links', $links));
12
        $links['config'][] = array(
13
                'href' => \SimpleSAML\Module::getModuleURL('monitor/monitor.php'),
14
                'text' => array('en' => 'Monitor'),
15
        );
16
}
17