Application   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 12
c 1
b 1
f 0
dl 0
loc 34
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A registerUserHooks() 0 4 1
A registerFileHooks() 0 4 1
A register() 0 7 1
A boot() 0 2 1
1
<?php
2
/**
3
 * Audioplayer
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the LICENSE.md file.
7
 *
8
 * @author Marcel Scherello <[email protected]>
9
 * @copyright 2020 Marcel Scherello
10
 */
11
12
namespace OCA\audioplayer\AppInfo;
13
14
use OCA\audioplayer\Dashboard\Widget;
15
use OCA\audioplayer\Listener\LoadAdditionalScripts;
16
use OCA\audioplayer\Search\Provider;
17
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...
18
use OCP\AppFramework\App;
19
use OCP\AppFramework\Bootstrap\IBootContext;
20
use OCP\AppFramework\Bootstrap\IBootstrap;
21
use OCP\AppFramework\Bootstrap\IRegistrationContext;
22
use OCP\Util;
23
24
class Application extends App implements IBootstrap
25
{
26
    public const APP_ID = 'audioplayer';
27
28
    public function __construct(array $urlParams = [])
29
    {
30
        parent::__construct(self::APP_ID, $urlParams);
31
    }
32
33
    public function register(IRegistrationContext $context): void
34
    {
35
        $context->registerDashboardWidget(Widget::class);
36
        $context->registerEventListener(BeforeTemplateRenderedEvent::class, LoadAdditionalScripts::class);
37
        $context->registerSearchProvider(Provider::class);
38
        $this->registerFileHooks();
39
        $this->registerUserHooks();
40
    }
41
42
    protected function registerFileHooks()
43
    {
44
        Util::connectHook(
0 ignored issues
show
Deprecated Code introduced by
The function OCP\Util::connectHook() has been deprecated: 21.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

44
        /** @scrutinizer ignore-deprecated */ Util::connectHook(

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
45
            'OC_Filesystem', 'delete', '\OCA\audioplayer\Hooks\FileHooks', 'deleteTrack'
46
        );
47
    }
48
49
    protected function registerUserHooks()
50
    {
51
        Util::connectHook(
0 ignored issues
show
Deprecated Code introduced by
The function OCP\Util::connectHook() has been deprecated: 21.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

51
        /** @scrutinizer ignore-deprecated */ Util::connectHook(

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
52
            'OC_User', 'post_deleteUser', '\OCA\audioplayer\Hooks\UserHooks', 'deleteUser'
53
        );
54
    }
55
56
    public function boot(IBootContext $context): void
57
    {
58
    }
59
60
}