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

Capabilities::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
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
namespace OCA\UserStatus;
26
27
use OCA\UserStatus\Service\EmojiService;
28
use OCP\Capabilities\ICapability;
29
30
/**
31
 * Class Capabilities
32
 *
33
 * @package OCA\UserStatus
34
 */
35
class Capabilities implements ICapability {
36
37
	/** @var EmojiService */
38
	private $emojiService;
39
40
	/**
41
	 * Capabilities constructor.
42
	 *
43
	 * @param EmojiService $emojiService
44
	 */
45
	public function __construct(EmojiService $emojiService) {
46
		$this->emojiService = $emojiService;
47
	}
48
49
	/**
50
	 * @inheritDoc
51
	 */
52
	public function getCapabilities() {
53
		return [
54
			'user_status' => [
55
				'enabled' => true,
56
				'supports_emoji' => $this->emojiService->doesPlatformSupportEmoji(),
57
			],
58
		];
59
	}
60
}
61