Passed
Push — master ( a291c5...6eae59 )
by Marcel
14:20 queued 12s
created

ReferenceListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
1
<?php
2
3
namespace OCA\Analytics\Listener;
4
5
use OCP\Collaboration\Reference\RenderReferenceEvent;
0 ignored issues
show
Bug introduced by
The type OCP\Collaboration\Reference\RenderReferenceEvent 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...
6
use OCP\EventDispatcher\Event;
7
use OCP\EventDispatcher\IEventListener;
8
use OCP\Util;
9
10
class ReferenceListener implements IEventListener {
11
    public function handle(Event $event): void {
12
        if (!$event instanceof RenderReferenceEvent) {
13
            return;
14
        }
15
16
        Util::addScript('analytics', 'reference');
17
    }
18
}