Filter::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace OCA\Mood\Activity;
5
6
use OCP\Activity\IFilter;
7
use OCP\IL10N;
8
use OCP\IURLGenerator;
9
10
class Filter implements IFilter {
11
12
	/** @var IL10N */
13
	protected $l10n;
14
15
	/** @var IURLGenerator */
16
	protected $url;
17
18
	public function __construct(IL10N $l10n, IURLGenerator $url) {
19
		$this->l10n = $l10n;
20
		$this->url = $url;
21
	}
22
23
	/**
24
	 * @return string Lowercase a-z only identifier
25
	 * @since 11.0.0
26
	 */
27
	public function getIdentifier() {
28
		return 'mood';
29
	}
30
31
	/**
32
	 * @return string A translated string
33
	 * @since 11.0.0
34
	 */
35
	public function getName() {
36
		return 'moods';
37
	}
38
39
	/**
40
	 * @return int
41
	 * @since 11.0.0
42
	 */
43
	public function getPriority() {
44
		return 10;
45
	}
46
47
	/**
48
	 * @return string Full URL to an icon, empty string when none is given
49
	 * @since 11.0.0
50
	 */
51
	public function getIcon() {
52
		return $this->url->getAbsoluteURL($this->url->imagePath('mood', 'mood_black.svg'));
53
	}
54
55
	/**
56
	 * @param string[] $types
57
	 *
58
	 * @return string[] An array of allowed apps from which activities should be displayed
59
	 * @since 11.0.0
60
	 */
61
	public function filterTypes(array $types) {
62
		return $types;
63
	}
64
65
	/**
66
	 * @return string[] An array of allowed apps from which activities should be displayed
67
	 * @since 11.0.0
68
	 */
69
	public function allowedApps() {
70
		return ['mood'];
71
	}
72
}
73
74