LoadAdditionalScripts   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Audio Player
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\audioplayer\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 OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent;
0 ignored issues
show
Bug introduced by
The type OCA\Files_Sharing\Event\...reTemplateRenderedEvent 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...
19
use OCP\EventDispatcher\Event;
20
use OCP\EventDispatcher\IEventListener;
21
use OCP\Util;
22
23
class LoadAdditionalScripts implements IEventListener
24
{
25
    public function handle(Event $event): void
26
    {
27
        if ($event instanceof BeforeTemplateRenderedEvent) {
28
            Util::addScript('audioplayer', 'viewer/viewer');
29
            Util::addScript('audioplayer', 'sharing/sharing');
30
            Util::addStyle('audioplayer', '3rdparty/fontello/css/fontello');
31
        } else {
32
            return;
33
        }
34
    }
35
}