Completed
Pull Request — master (#195)
by John
02:42
created

Application::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright 2020 Morris Jobke <[email protected]>
7
 *
8
 * @author Morris Jobke <[email protected]>
9
 * @author John Molakvoæ <[email protected]>
10
 *
11
 * @license GNU AGPL version 3 or any later version
12
 *
13
 * This program is free software: you can redistribute it and/or modify
14
 * it under the terms of the GNU Affero General Public License as
15
 * published by the Free Software Foundation, either version 3 of the
16
 * License, or (at your option) any later version.
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
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 *
26
 */
27
28
namespace OCA\Files_PDFViewer\AppInfo;
29
30
use OCA\Files_PDFViewer\Listeners\LoadViewerListener;
31
use OCA\Viewer\Event\LoadViewer;
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\Util;
37
38
class Application extends App implements IBootstrap {
39
	public const APP_ID = 'files_pdfviewer';
40
41
	public function __construct() {
42
		parent::__construct(self::APP_ID);
43
	}
44
45
	public function register(IRegistrationContext $context): void {
46
		$context->registerEventListener(LoadViewer::class, LoadViewerListener::class);
47
	}
48
49
	public function boot(IBootContext $context): void {
50
		Util::addScript(self::APP_ID, 'previewplugin');
51
		Util::addStyle(self::APP_ID, 'style');
52
	}
53
}
54