Passed
Push — master ( 874eff...d311e0 )
by Roeland
16:04 queued 10s
created

Application::deleteUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright Copyright (c) 2017 Joas Schilling <[email protected]>
7
 *
8
 * @author Christoph Wurst <[email protected]>
9
 * @author Joas Schilling <[email protected]>
10
 * @author Roeland Jago Douma <[email protected]>
11
 *
12
 * @license GNU AGPL version 3 or any later version
13
 *
14
 * This program is free software: you can redistribute it and/or modify
15
 * it under the terms of the GNU Affero General Public License as
16
 * published by the Free Software Foundation, either version 3 of the
17
 * License, or (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU Affero General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU Affero General Public License
25
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26
 *
27
 */
28
29
namespace OCA\TwoFactorBackupCodes\AppInfo;
30
31
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
32
use OCA\TwoFactorBackupCodes\Listener\ActivityPublisher;
33
use OCA\TwoFactorBackupCodes\Listener\ClearNotifications;
34
use OCA\TwoFactorBackupCodes\Listener\ProviderDisabled;
35
use OCA\TwoFactorBackupCodes\Listener\ProviderEnabled;
36
use OCA\TwoFactorBackupCodes\Listener\RegistryUpdater;
37
use OCA\TwoFactorBackupCodes\Listener\UserDeleted;
38
use OCA\TwoFactorBackupCodes\Notifications\Notifier;
39
use OCP\AppFramework\App;
40
use OCP\AppFramework\Bootstrap\IBootContext;
41
use OCP\AppFramework\Bootstrap\IBootstrap;
42
use OCP\AppFramework\Bootstrap\IRegistrationContext;
43
use OCP\Authentication\TwoFactorAuth\IRegistry;
44
use OCP\User\Events\UserDeletedEvent;
45
46
class Application extends App implements IBootstrap {
47
	public const APP_ID = 'twofactor_backupcodes';
48
49
	public function __construct() {
50
		parent::__construct(self::APP_ID);
51
	}
52
53
	public function register(IRegistrationContext $context): void {
54
		$context->registerNotifierService(Notifier::class);
55
56
		$context->registerEventListener(CodesGenerated::class, ActivityPublisher::class);
57
		$context->registerEventListener(CodesGenerated::class, RegistryUpdater::class);
58
		$context->registerEventListener(CodesGenerated::class, ClearNotifications::class);
59
		$context->registerEventListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class);
0 ignored issues
show
Deprecated Code introduced by
The constant OCP\Authentication\TwoFa...:EVENT_PROVIDER_ENABLED has been deprecated: 22.0.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

59
		$context->registerEventListener(/** @scrutinizer ignore-deprecated */ IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class);

This class constant has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.

Loading history...
60
		$context->registerEventListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class);
0 ignored issues
show
Deprecated Code introduced by
The constant OCP\Authentication\TwoFa...EVENT_PROVIDER_DISABLED has been deprecated: 22.0.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

60
		$context->registerEventListener(/** @scrutinizer ignore-deprecated */ IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class);

This class constant has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.

Loading history...
61
		$context->registerEventListener(UserDeletedEvent::class, UserDeleted::class);
62
	}
63
64
	public function boot(IBootContext $context): void {
65
	}
66
}
67