Passed
Pull Request — master (#442)
by Matias
07:21 queued 05:22
created

Application   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A boot() 0 2 1
A register() 0 5 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * @copyright Copyright (c) 2016, Roeland Jago Douma <[email protected]>
5
 * @copyright Copyright (c) 2017-2021 Matias De lellis <[email protected]>
6
 * @copyright Copyright (c) 2020 Xiangbin Li >[email protected]>
7
 *
8
 * @author Roeland Jago Douma <[email protected]>
9
 * @author Matias De lellis <[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\FaceRecognition\AppInfo;
29
30
use OCP\AppFramework\App;
31
use OCP\AppFramework\Bootstrap\IBootstrap;
32
use OCP\AppFramework\Bootstrap\IRegistrationContext;
33
use OCP\AppFramework\Bootstrap\IBootContext;
34
use OCP\AppFramework\IAppContainer;
35
36
use OCP\EventDispatcher\IEventDispatcher;
37
38
use OCA\Files\Event\LoadSidebar;
0 ignored issues
show
Bug introduced by
The type OCA\Files\Event\LoadSidebar 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...
39
use OCP\User\Events\UserDeletedEvent;
40
41
use OCA\FaceRecognition\Hooks\FileHooks;
42
43
use OCA\FaceRecognition\Listener\LoadSidebarListener;
44
use OCA\FaceRecognition\Listener\UserDeletedListener;
0 ignored issues
show
Bug introduced by
The type OCA\FaceRecognition\Listener\UserDeletedListener 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...
45
46
use OCA\FaceRecognition\Search\PersonSearchProvider;
47
48
class Application extends App implements IBootstrap {
49
50
	/** @var string */
51
	public const APP_NAME = 'facerecognition';
52
53
	/**
54
	 * Application constructor.
55
	 *
56
	 * @param array $urlParams
57
	 */
58
	public function __construct(array $urlParams = []) {
59
		parent::__construct(self::APP_NAME, $urlParams);
60
	}
61
62
	public function register(IRegistrationContext $context): void {
63
		$context->registerSearchProvider(PersonSearchProvider::class);
64
65
		$context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class);
66
		$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
67
	}
68
69
	public function boot(IBootContext $context): void {
70
		$context->getAppContainer()->get(FileHooks::class)->register();
71
	}
72
73
}
74