These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | require_once __DIR__ . '/vendor/autoload.php'; |
||
4 | |||
5 | use Battis\ConfigXML; |
||
6 | use smtech\CanvasPest\CanvasPest; |
||
7 | use smtech\StMarksSearch\SearchEngine; |
||
8 | use smtech\StMarksSearch\Canvas\Courses\CourseSearch; |
||
9 | use smtech\StMarksSearch\WordPress\WordPressSearch; |
||
10 | use smtech\StMarksSearch\LibApps\LibGuides\LibGuidesSearch; |
||
11 | |||
12 | if (empty($config)) { |
||
13 | $config = __DIR__ . '/config.xml'; |
||
14 | } |
||
15 | |||
16 | $config = new ConfigXML($config); |
||
17 | |||
18 | $search = new SearchEngine($config->toArray('/config/engine')[0]); |
||
19 | |||
20 | if ($canvases = $config->toArray('/config/canvas')) { |
||
21 | foreach ($canvases as $canvas) { |
||
22 | $api = new CanvasPest($canvas['api']['url'], $canvas['api']['token']); |
||
23 | if (count($canvas['course']) > 1) { |
||
24 | foreach ($canvas['course'] as $course) { |
||
25 | $course['@attributes']['api'] = $api; |
||
26 | $search->addDomain(new CourseSearch($course['@attributes'])); |
||
27 | } |
||
28 | } else { |
||
29 | $search->addDomain(new CourseSearch($api, $canvas['course']['@attributes'])); |
||
0 ignored issues
–
show
|
|||
30 | } |
||
31 | } |
||
32 | } |
||
33 | |||
34 | if ($blogs = $config->toArray('/config/wordpress/blog')) { |
||
35 | foreach ($blogs as $blog) { |
||
36 | $search->addDomain(new WordPressSearch($blog['@attributes'])); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | if ($libguides = $config->toArray('/config/libapps/libguides')) { |
||
41 | foreach ($libguides as $libguide) { |
||
42 | $search->addDomain(new LibGuidesSearch($libguide['@attributes'])); |
||
43 | } |
||
44 | } |
||
45 |
This check compares calls to functions or methods with their respective definitions. If the call has more 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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.