Passed
Push — master ( a5cc5f...186dbc )
by Mark
02:06 queued 50s
created

action_plugin_geophp::popularity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
1
<?php
2
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
3
// phpcs:disable PSR1.Files.SideEffects
4
/*
5
* Copyright (c) 2022 Mark C. Prins <[email protected]>
6
*
7
* Permission to use, copy, modify, and distribute this software for any
8
* purpose with or without fee is hereby granted, provided that the above
9
* copyright notice and this permission notice appear in all copies.
10
*
11
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
*
19
*/
20
21
use Composer\InstalledVersions;
22
23
require_once __DIR__ . '/vendor/autoload.php';
24
25
/**
26
 * DokuWiki Plugin geophp (Action Component).
27
 *
28
 * @author Mark Prins
29
 */
30
class action_plugin_geophp extends DokuWiki_Plugin {
0 ignored issues
show
Bug introduced by
The type DokuWiki_Plugin was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
    /**
32
     * plugin should use this method to register its handlers with the DokuWiki's event controller
33
     *
34
     * @param    $controller DokuWiki's event controller object. Also available as global $EVENT_HANDLER
0 ignored issues
show
Documentation Bug introduced by
The doc comment DokuWiki's at position 0 could not be parsed: Unknown type name 'DokuWiki's' at position 0 in DokuWiki's.
Loading history...
35
     */
36
    final public function register(Doku_Event_Handler $controller): void {
0 ignored issues
show
Bug introduced by
The type Doku_Event_Handler was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
37
        $controller->register_hook('PLUGIN_POPULARITY_DATA_SETUP', 'AFTER', $this, 'popularity');
38
    }
39
40
    /**
41
     * add popularity data for this plugin.
42
     *
43
     * @param Doku_Event $event
44
     *          the DokuWiki event
45
     */
46
    final public function popularity(Doku_Event $event): void {
0 ignored issues
show
Bug introduced by
The type Doku_Event was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
        global $updateVersion;
48
        $geoPHP                                   = InstalledVersions::getPrettyVersion('phayes/geophp');
49
        $plugin_info                              = $this->getInfo();
50
        $event->data['geophp']['version']         = $plugin_info['date'];
51
        $event->data['geophp']['geophp']          = $geoPHP;
52
        $event->data['geophp']['dwversion']       = $updateVersion;
53
        $event->data['geophp']['combinedversion'] = $updateVersion . '_' . $plugin_info['date'] . '_' . $geoPHP;
54
    }
55
}