Setting::canChangeMail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * @copyright Copyright (c) 2016 Joas Schilling <[email protected]>
5
 *
6
 * @license GNU AGPL version 3 or any later version
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License as
10
 * published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 *
21
 */
22
23
namespace OCA\AnnouncementCenter\Activity;
24
25
26
use OCP\Activity\ISetting;
27
use OCP\IL10N;
28
29
class Setting implements ISetting {
30
31
	/** @var IL10N */
32
	protected $l;
33
34
	/**
35
	 * @param IL10N $l
36
	 */
37 1
	public function __construct(IL10N $l) {
38 1
		$this->l = $l;
39 1
	}
40
41
	/**
42
	 * @return string Lowercase a-z and underscore only identifier
43
	 * @since 11.0.0
44
	 */
45 1
	public function getIdentifier(): string {
46 1
		return 'announcementcenter';
47
	}
48
49
	/**
50
	 * @return string A translated string
51
	 * @since 11.0.0
52
	 */
53 1
	public function getName(): string {
54 1
		return $this->l->t('An <strong>announcement</strong> is posted by an administrator');
55
	}
56
57
	/**
58
	 * @return int whether the filter should be rather on the top or bottom of
59
	 * the admin section. The filters are arranged in ascending order of the
60
	 * priority values. It is required to return a value between 0 and 100.
61
	 * @since 11.0.0
62
	 */
63 1
	public function getPriority(): int {
64 1
		return 70;
65
	}
66
67
	/**
68
	 * @return bool True when the option can be changed for the stream
69
	 * @since 11.0.0
70
	 */
71 1
	public function canChangeStream(): bool {
72 1
		return false;
73
	}
74
75
	/**
76
	 * @return bool True when the option can be changed for the stream
77
	 * @since 11.0.0
78
	 */
79 1
	public function isDefaultEnabledStream(): bool {
80 1
		return true;
81
	}
82
83
	/**
84
	 * @return bool True when the option can be changed for the mail
85
	 * @since 11.0.0
86
	 */
87 1
	public function canChangeMail(): bool {
88 1
		return true;
89
	}
90
91
	/**
92
	 * @return bool True when the option can be changed for the stream
93
	 * @since 11.0.0
94
	 */
95 1
	public function isDefaultEnabledMail(): bool {
96 1
		return true;
97
	}
98
}
99
100