Passed
Push — master ( a169bd...ce314d )
by Morris
25:36 queued 14:17
created

Application   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 1
A __construct() 0 2 1
A boot() 0 1 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Björn Schießle <[email protected]>
6
 * @author Christoph Wurst <[email protected]>
7
 * @author Joas Schilling <[email protected]>
8
 * @author Morris Jobke <[email protected]>
9
 * @author Roeland Jago Douma <[email protected]>
10
 * @author Thomas Müller <[email protected]>
11
 *
12
 * @license AGPL-3.0
13
 *
14
 * This code is free software: you can redistribute it and/or modify
15
 * it under the terms of the GNU Affero General Public License, version 3,
16
 * as published by the Free Software Foundation.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
 * GNU Affero General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU Affero General Public License, version 3,
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>
25
 *
26
 */
27
28
namespace OCA\Federation\AppInfo;
29
30
use OCA\DAV\Events\SabrePluginAuthInitEvent;
31
use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
32
use OCA\Federation\Listener\FederatedShareAddedListener;
33
use OCA\Federation\Listener\SabrePluginAuthInitListener;
34
use OCA\Federation\Middleware\AddServerMiddleware;
35
use OCP\AppFramework\App;
36
use OCP\AppFramework\Bootstrap\IBootContext;
37
use OCP\AppFramework\Bootstrap\IBootstrap;
38
use OCP\AppFramework\Bootstrap\IRegistrationContext;
39
40
class Application extends App implements IBootstrap {
41
42
	/**
43
	 * @param array $urlParams
44
	 */
45
	public function __construct($urlParams = []) {
46
		parent::__construct('federation', $urlParams);
47
	}
48
49
	public function register(IRegistrationContext $context): void {
50
		$context->registerMiddleware(AddServerMiddleware::class);
51
52
		$context->registerEventListener(FederatedShareAddedEvent::class, FederatedShareAddedListener::class);
53
		$context->registerEventListener(SabrePluginAuthInitEvent::class, SabrePluginAuthInitListener::class);
54
	}
55
56
	public function boot(IBootContext $context): void {
57
	}
58
}
59