Code Duplication    Length = 46-46 lines in 2 locations

lib/Settings/AdminSection.php 1 location

@@ 34-79 (lines=46) @@
31
use OCP\IURLGenerator;
32
use OCP\Settings\IIconSection;
33
34
class AdminSection implements IIconSection {
35
36
	/** @var IL10N */
37
	private $l10n;
38
39
	/** @var IURLGenerator */
40
	private $urlGenerator;
41
42
	/**
43
	 * @param IL10N $l10n
44
	 * @param IURLGenerator $urlGenerator
45
	 */
46
	public function __construct(IL10N $l10n,
47
								IURLGenerator $urlGenerator) {
48
		$this->l10n = $l10n;
49
		$this->urlGenerator = $urlGenerator;
50
	}
51
52
	/**
53
	 * {@inheritdoc}
54
	 */
55
	public function getID() {
56
		return Application::APP_NAME;
57
	}
58
59
	/**
60
	 * {@inheritdoc}
61
	 */
62
	public function getName() {
63
		return $this->l10n->t('Pico CMS');
64
	}
65
66
	/**
67
	 * {@inheritdoc}
68
	 */
69
	public function getPriority() {
70
		return 75;
71
	}
72
73
	/**
74
	 * {@inheritdoc}
75
	 */
76
	public function getIcon() {
77
		return $this->urlGenerator->imagePath(Application::APP_NAME, 'pico_cms.svg');
78
	}
79
}
80

lib/Settings/PersonalSection.php 1 location

@@ 34-79 (lines=46) @@
31
use OCP\IURLGenerator;
32
use OCP\Settings\IIconSection;
33
34
class PersonalSection implements IIconSection {
35
36
	/** @var IL10N */
37
	private $l10n;
38
39
	/** @var IURLGenerator */
40
	private $urlGenerator;
41
42
	/**
43
	 * @param IL10N $l10n
44
	 * @param IURLGenerator $urlGenerator
45
	 */
46
	public function __construct(IL10N $l10n,
47
								IURLGenerator $urlGenerator) {
48
		$this->l10n = $l10n;
49
		$this->urlGenerator = $urlGenerator;
50
	}
51
52
	/**
53
	 * {@inheritdoc}
54
	 */
55
	public function getID() {
56
		return Application::APP_NAME;
57
	}
58
59
	/**
60
	 * {@inheritdoc}
61
	 */
62
	public function getName() {
63
		return $this->l10n->t('Pico CMS');
64
	}
65
66
	/**
67
	 * {@inheritdoc}
68
	 */
69
	public function getPriority() {
70
		return 75;
71
	}
72
73
	/**
74
	 * {@inheritdoc}
75
	 */
76
	public function getIcon() {
77
		return $this->urlGenerator->imagePath(Application::APP_NAME, 'pico_cms.svg');
78
	}
79
}
80