Passed
Push — master ( fce6df...8e01ff )
by Georg
14:04 queued 11s
created

Application   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 1 1
A register() 0 8 1
A __construct() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright Copyright (c) 2020, Georg Ehrke
7
 *
8
 * @author Georg Ehrke <[email protected]>
9
 *
10
 * @license AGPL-3.0
11
 *
12
 * This code is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License, version 3,
14
 * as published by the Free Software Foundation.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
 * GNU Affero General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU Affero General Public License, version 3,
22
 * along with this program. If not, see <http://www.gnu.org/licenses/>
23
 *
24
 */
25
26
namespace OCA\UserStatus\AppInfo;
27
28
use OCA\UserStatus\Capabilities;
29
use OCA\UserStatus\Listener\BeforeTemplateRenderedListener;
30
use OCA\UserStatus\Listener\UserDeletedListener;
31
use OCA\UserStatus\Listener\UserLiveStatusListener;
32
use OCP\AppFramework\App;
33
use OCP\AppFramework\Bootstrap\IBootContext;
34
use OCP\AppFramework\Bootstrap\IBootstrap;
35
use OCP\AppFramework\Bootstrap\IRegistrationContext;
36
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
37
use OCP\User\Events\UserDeletedEvent;
38
use OCP\User\Events\UserLiveStatusEvent;
39
40
/**
41
 * Class Application
42
 *
43
 * @package OCA\UserStatus\AppInfo
44
 */
45
class Application extends App implements IBootstrap {
46
47
	/** @var string */
48
	public const APP_ID = 'user_status';
49
50
	/**
51
	 * Application constructor.
52
	 *
53
	 * @param array $urlParams
54
	 */
55
	public function __construct(array $urlParams = []) {
56
		parent::__construct(self::APP_ID, $urlParams);
57
	}
58
59
	/**
60
	 * @inheritDoc
61
	 */
62
	public function register(IRegistrationContext $context): void {
63
		// Register OCS Capabilities
64
		$context->registerCapability(Capabilities::class);
65
66
		// Register Event Listeners
67
		$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
68
		$context->registerEventListener(UserLiveStatusEvent::class, UserLiveStatusListener::class);
69
		$context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
70
	}
71
72
	public function boot(IBootContext $context): void {
73
	}
74
}
75