Passed
Push — master ( f9711f...d95d65 )
by Marcel
02:19
created

LoadAdditionalScripts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Analytics
7
 *
8
 * This file is licensed under the Affero General Public License version 3 or
9
 * later. See the LICENSE.md file.
10
 *
11
 * @author Marcel Scherello <[email protected]>
12
 * @copyright 2020 Marcel Scherello
13
 */
14
15
namespace OCA\Analytics\Listener;
16
17
use OCA\Files\Event\LoadAdditionalScriptsEvent;
0 ignored issues
show
Bug introduced by
The type OCA\Files\Event\LoadAdditionalScriptsEvent 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...
18
use OCP\EventDispatcher\Event;
19
use OCP\EventDispatcher\IEventListener;
20
use OCP\Util;
21
22
class LoadAdditionalScripts implements IEventListener
23
{
24
    public function handle(Event $event): void
25
    {
26
        if (!($event instanceof LoadAdditionalScriptsEvent)) {
27
            return;
28
        }
29
        Util::addScript('analytics', 'viewer');
30
    }
31
}