Code Duplication    Length = 70-70 lines in 5 locations

apps/files/lib/Activity/Settings/FileChanged.php 1 location

@@ 28-97 (lines=70) @@
25
use OCP\Activity\ISetting;
26
use OCP\IL10N;
27
28
class FileChanged implements ISetting {
29
30
	/** @var IL10N */
31
	protected $l;
32
33
	/**
34
	 * @param IL10N $l
35
	 */
36
	public function __construct(IL10N $l) {
37
		$this->l = $l;
38
	}
39
40
	/**
41
	 * @return string Lowercase a-z and underscore only identifier
42
	 * @since 11.0.0
43
	 */
44
	public function getIdentifier() {
45
		return 'file_changed';
46
	}
47
48
	/**
49
	 * @return string A translated string
50
	 * @since 11.0.0
51
	 */
52
	public function getName() {
53
		return $this->l->t('A file or folder has been <strong>changed</strong> or <strong>renamed</strong>');
54
	}
55
56
	/**
57
	 * @return int whether the filter should be rather on the top or bottom of
58
	 * the admin section. The filters are arranged in ascending order of the
59
	 * priority values. It is required to return a value between 0 and 100.
60
	 * @since 11.0.0
61
	 */
62
	public function getPriority() {
63
		return 1;
64
	}
65
66
	/**
67
	 * @return bool True when the option can be changed for the stream
68
	 * @since 11.0.0
69
	 */
70
	public function canChangeStream() {
71
		return true;
72
	}
73
74
	/**
75
	 * @return bool True when the option can be changed for the stream
76
	 * @since 11.0.0
77
	 */
78
	public function isDefaultEnabledStream() {
79
		return true;
80
	}
81
82
	/**
83
	 * @return bool True when the option can be changed for the mail
84
	 * @since 11.0.0
85
	 */
86
	public function canChangeMail() {
87
		return true;
88
	}
89
90
	/**
91
	 * @return bool True when the option can be changed for the stream
92
	 * @since 11.0.0
93
	 */
94
	public function isDefaultEnabledMail() {
95
		return false;
96
	}
97
}
98
99

apps/files/lib/Activity/Settings/FileCreated.php 1 location

@@ 28-97 (lines=70) @@
25
use OCP\Activity\ISetting;
26
use OCP\IL10N;
27
28
class FileCreated implements ISetting {
29
30
	/** @var IL10N */
31
	protected $l;
32
33
	/**
34
	 * @param IL10N $l
35
	 */
36
	public function __construct(IL10N $l) {
37
		$this->l = $l;
38
	}
39
40
	/**
41
	 * @return string Lowercase a-z and underscore only identifier
42
	 * @since 11.0.0
43
	 */
44
	public function getIdentifier() {
45
		return 'file_created';
46
	}
47
48
	/**
49
	 * @return string A translated string
50
	 * @since 11.0.0
51
	 */
52
	public function getName() {
53
		return $this->l->t('A new file or folder has been <strong>created</strong>');
54
	}
55
56
	/**
57
	 * @return int whether the filter should be rather on the top or bottom of
58
	 * the admin section. The filters are arranged in ascending order of the
59
	 * priority values. It is required to return a value between 0 and 100.
60
	 * @since 11.0.0
61
	 */
62
	public function getPriority() {
63
		return 0;
64
	}
65
66
	/**
67
	 * @return bool True when the option can be changed for the stream
68
	 * @since 11.0.0
69
	 */
70
	public function canChangeStream() {
71
		return true;
72
	}
73
74
	/**
75
	 * @return bool True when the option can be changed for the stream
76
	 * @since 11.0.0
77
	 */
78
	public function isDefaultEnabledStream() {
79
		return true;
80
	}
81
82
	/**
83
	 * @return bool True when the option can be changed for the mail
84
	 * @since 11.0.0
85
	 */
86
	public function canChangeMail() {
87
		return true;
88
	}
89
90
	/**
91
	 * @return bool True when the option can be changed for the stream
92
	 * @since 11.0.0
93
	 */
94
	public function isDefaultEnabledMail() {
95
		return false;
96
	}
97
}
98
99

apps/files/lib/Activity/Settings/FileDeleted.php 1 location

@@ 28-97 (lines=70) @@
25
use OCP\Activity\ISetting;
26
use OCP\IL10N;
27
28
class FileDeleted implements ISetting {
29
30
	/** @var IL10N */
31
	protected $l;
32
33
	/**
34
	 * @param IL10N $l
35
	 */
36
	public function __construct(IL10N $l) {
37
		$this->l = $l;
38
	}
39
40
	/**
41
	 * @return string Lowercase a-z and underscore only identifier
42
	 * @since 11.0.0
43
	 */
44
	public function getIdentifier() {
45
		return 'file_deleted';
46
	}
47
48
	/**
49
	 * @return string A translated string
50
	 * @since 11.0.0
51
	 */
52
	public function getName() {
53
		return $this->l->t('A new file or folder has been <strong>deleted</strong>');
54
	}
55
56
	/**
57
	 * @return int whether the filter should be rather on the top or bottom of
58
	 * the admin section. The filters are arranged in ascending order of the
59
	 * priority values. It is required to return a value between 0 and 100.
60
	 * @since 11.0.0
61
	 */
62
	public function getPriority() {
63
		return 3;
64
	}
65
66
	/**
67
	 * @return bool True when the option can be changed for the stream
68
	 * @since 11.0.0
69
	 */
70
	public function canChangeStream() {
71
		return true;
72
	}
73
74
	/**
75
	 * @return bool True when the option can be changed for the stream
76
	 * @since 11.0.0
77
	 */
78
	public function isDefaultEnabledStream() {
79
		return true;
80
	}
81
82
	/**
83
	 * @return bool True when the option can be changed for the mail
84
	 * @since 11.0.0
85
	 */
86
	public function canChangeMail() {
87
		return true;
88
	}
89
90
	/**
91
	 * @return bool True when the option can be changed for the stream
92
	 * @since 11.0.0
93
	 */
94
	public function isDefaultEnabledMail() {
95
		return false;
96
	}
97
}
98
99

apps/files/lib/Activity/Settings/FileFavorite.php 1 location

@@ 28-97 (lines=70) @@
25
use OCP\Activity\ISetting;
26
use OCP\IL10N;
27
28
class FileFavorite implements ISetting {
29
30
	/** @var IL10N */
31
	protected $l;
32
33
	/**
34
	 * @param IL10N $l
35
	 */
36
	public function __construct(IL10N $l) {
37
		$this->l = $l;
38
	}
39
40
	/**
41
	 * @return string Lowercase a-z and underscore only identifier
42
	 * @since 11.0.0
43
	 */
44
	public function getIdentifier() {
45
		return 'file_favorite';
46
	}
47
48
	/**
49
	 * @return string A translated string
50
	 * @since 11.0.0
51
	 */
52
	public function getName() {
53
		return $this->l->t('Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>');
54
	}
55
56
	/**
57
	 * @return int whether the filter should be rather on the top or bottom of
58
	 * the admin section. The filters are arranged in ascending order of the
59
	 * priority values. It is required to return a value between 0 and 100.
60
	 * @since 11.0.0
61
	 */
62
	public function getPriority() {
63
		return 2;
64
	}
65
66
	/**
67
	 * @return bool True when the option can be changed for the stream
68
	 * @since 11.0.0
69
	 */
70
	public function canChangeStream() {
71
		return true;
72
	}
73
74
	/**
75
	 * @return bool True when the option can be changed for the stream
76
	 * @since 11.0.0
77
	 */
78
	public function isDefaultEnabledStream() {
79
		return false;
80
	}
81
82
	/**
83
	 * @return bool True when the option can be changed for the mail
84
	 * @since 11.0.0
85
	 */
86
	public function canChangeMail() {
87
		return false;
88
	}
89
90
	/**
91
	 * @return bool True when the option can be changed for the stream
92
	 * @since 11.0.0
93
	 */
94
	public function isDefaultEnabledMail() {
95
		return false;
96
	}
97
}
98
99

apps/files/lib/Activity/Settings/FileRestored.php 1 location

@@ 28-97 (lines=70) @@
25
use OCP\Activity\ISetting;
26
use OCP\IL10N;
27
28
class FileRestored implements ISetting {
29
30
	/** @var IL10N */
31
	protected $l;
32
33
	/**
34
	 * @param IL10N $l
35
	 */
36
	public function __construct(IL10N $l) {
37
		$this->l = $l;
38
	}
39
40
	/**
41
	 * @return string Lowercase a-z and underscore only identifier
42
	 * @since 11.0.0
43
	 */
44
	public function getIdentifier() {
45
		return 'file_restored';
46
	}
47
48
	/**
49
	 * @return string A translated string
50
	 * @since 11.0.0
51
	 */
52
	public function getName() {
53
		return $this->l->t('A new file or folder has been <strong>restored</strong>');
54
	}
55
56
	/**
57
	 * @return int whether the filter should be rather on the top or bottom of
58
	 * the admin section. The filters are arranged in ascending order of the
59
	 * priority values. It is required to return a value between 0 and 100.
60
	 * @since 11.0.0
61
	 */
62
	public function getPriority() {
63
		return 4;
64
	}
65
66
	/**
67
	 * @return bool True when the option can be changed for the stream
68
	 * @since 11.0.0
69
	 */
70
	public function canChangeStream() {
71
		return true;
72
	}
73
74
	/**
75
	 * @return bool True when the option can be changed for the stream
76
	 * @since 11.0.0
77
	 */
78
	public function isDefaultEnabledStream() {
79
		return true;
80
	}
81
82
	/**
83
	 * @return bool True when the option can be changed for the mail
84
	 * @since 11.0.0
85
	 */
86
	public function canChangeMail() {
87
		return true;
88
	}
89
90
	/**
91
	 * @return bool True when the option can be changed for the stream
92
	 * @since 11.0.0
93
	 */
94
	public function isDefaultEnabledMail() {
95
		return false;
96
	}
97
}
98
99