Application::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Analytics
4
 *
5
 * SPDX-FileCopyrightText: 2019-2022 Marcel Scherello
6
 * SPDX-License-Identifier: AGPL-3.0-or-later
7
 */
8
9
namespace OCA\Analytics\AppInfo;
10
11
use OCA\Analytics\ContextChat\ContentProvider;
12
use OCA\Analytics\Dashboard\Widget;
13
use OCA\Analytics\Flow\FlowOperation;
14
// use OCA\Analytics\Listener\LoadAdditionalScripts;
15
use OCA\Analytics\Listener\UserDeletedListener;
16
use OCA\Analytics\Notification\Notifier;
17
use OCA\Analytics\Search\SearchProvider;
18
use OCA\Analytics\Listener\ReferenceListener;
19
use OCA\Analytics\Reference\ReferenceProvider;
20
// use OCA\Files\Event\LoadAdditionalScriptsEvent;
21
use OCP\AppFramework\App;
0 ignored issues
show
Bug introduced by
The type OCP\AppFramework\App 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...
22
use OCP\AppFramework\Bootstrap\IBootContext;
0 ignored issues
show
Bug introduced by
The type OCP\AppFramework\Bootstrap\IBootContext 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...
23
use OCP\AppFramework\Bootstrap\IBootstrap;
0 ignored issues
show
Bug introduced by
The type OCP\AppFramework\Bootstrap\IBootstrap 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...
24
use OCP\AppFramework\Bootstrap\IRegistrationContext;
0 ignored issues
show
Bug introduced by
The type OCP\AppFramework\Bootstrap\IRegistrationContext 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...
25
use OCP\EventDispatcher\IEventDispatcher;
0 ignored issues
show
Bug introduced by
The type OCP\EventDispatcher\IEventDispatcher 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...
26
use OCP\User\Events\UserDeletedEvent;
0 ignored issues
show
Bug introduced by
The type OCP\User\Events\UserDeletedEvent 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...
27
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...
28
use Psr\Container\ContainerInterface;
0 ignored issues
show
Bug introduced by
The type Psr\Container\ContainerInterface 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...
29
use OCP\WorkflowEngine\Events\RegisterOperationsEvent;
0 ignored issues
show
Bug introduced by
The type OCP\WorkflowEngine\Events\RegisterOperationsEvent 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...
30
use OCA\ContextChat\Event\ContentProviderRegisterEvent;
0 ignored issues
show
Bug introduced by
The type OCA\ContextChat\Event\ContentProviderRegisterEvent 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
class Application extends App implements IBootstrap {
33
	public const APP_ID = 'analytics';
34
35
	public function __construct(array $urlParams = []) {
36
		parent::__construct(self::APP_ID, $urlParams);
37
	}
38
39
	public function register(IRegistrationContext $context): void {
40
		$context->registerDashboardWidget(Widget::class);
41
42
		$context->registerSearchProvider(SearchProvider::class);
43
44
		// file actions are not working at the moment
45
		// $context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class);
46
		$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
47
		$context->registerEventListener(RegisterOperationsEvent::class, FlowOperation::class);
48
		$context->registerEventListener(ContentProviderRegisterEvent::class, ContentProvider::class);
49
50
		if (method_exists($context, 'registerReferenceProvider')) {
51
			$context->registerReferenceProvider(ReferenceProvider::class);
52
			$context->registerEventListener(RenderReferenceEvent::class, ReferenceListener::class);
53
		}
54
55
		$this->registerNotifications();
56
	}
57
58
	public function boot(IBootContext $context): void {
59
	}
60
61
	protected function registerNotifications(): void {
62
		$notificationManager = \OC::$server->getNotificationManager();
63
		$notificationManager->registerNotifierService(Notifier::class);
64
	}
65
}