Passed
Push — master ( ecb34d...b8eee1 )
by Maxence
02:13
created

Personal   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
dl 0
loc 47
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSection() 0 2 1
A getForm() 0 8 1
A getPriority() 0 2 1
1
<?php
2
/**
3
 * CMS Pico - Integration of Pico within your files to create websites.
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Maxence Lange <[email protected]>
9
 * @copyright 2017
10
 * @license GNU AGPL version 3 or any later version
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License as
14
 * published by the Free Software Foundation, either version 3 of the
15
 * License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License
23
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 *
25
 */
26
27
namespace OCA\CMSPico\Settings;
28
29
use OCA\CMSPico\AppInfo\Application;
30
use OCA\CMSPico\Service\TemplatesService;
31
use OCP\AppFramework\Http\TemplateResponse;
32
use OCP\IL10N;
33
use OCP\Settings\ISettings;
0 ignored issues
show
Bug introduced by
The type OCP\Settings\ISettings was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
34
35
class Personal implements ISettings {
36
37
	/** @var IL10N */
38
	private $l10n;
39
40
	/** @var TemplatesService */
41
	private $templatesService;
42
43
	/**
44
	 * @param IL10N $l10n
45
	 * @param TemplatesService $templatesService
46
	 */
47
	public function __construct(IL10N $l10n, TemplatesService $templatesService) {
48
		\OC::$server->getLogger()->log(4, '______');
49
		$this->l10n = $l10n;
50
		$this->templatesService = $templatesService;
51
	}
52
53
	/**
54
	 * @return TemplateResponse
55
	 */
56
	public function getForm() {
57
		$data = [
58
			'templates' => $this->templatesService->getTemplatesList()
59
		];
60
61
		\OC::$server->getLogger()->log(4, '______2');
62
63
		return new TemplateResponse(Application::APP_NAME, 'settings.personal', $data);
64
	}
65
66
	/**
67
	 * @return string the section ID, e.g. 'sharing'
68
	 */
69
	public function getSection() {
70
		return Application::APP_NAME;
71
	}
72
73
	/**
74
	 * @return int whether the form should be rather on the top or bottom of
75
	 * the admin section. The forms are arranged in ascending order of the
76
	 * priority values. It is required to return a value between 0 and 100.
77
	 *
78
	 * keep the server setting at the top, right after "server settings"
79
	 */
80
	public function getPriority() {
81
		return 0;
82
	}
83
84
}
85