Issues (195)

lib/Settings/Admin.php (3 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * @copyright Copyright (c) 2017 Matthias Held <[email protected]>
5
 * @author Matthias Held <[email protected]>
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 <https://www.gnu.org/licenses/>.
20
 */
21
22
namespace OCA\RansomwareDetection\Settings;
23
24
use OCA\RansomwareDetection\AppInfo\Application;
25
use OCP\AppFramework\Http\TemplateResponse;
0 ignored issues
show
The type OCP\AppFramework\Http\TemplateResponse 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...
26
use OCP\IConfig;
0 ignored issues
show
The type OCP\IConfig 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...
27
use OCP\Settings\ISettings;
0 ignored issues
show
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...
28
29
class Admin implements ISettings
30
{
31
    /** @var IConfig */
32
    protected $config;
33
34
    /**
35
     * @param IConfig $config
36
     */
37
    public function __construct(
38
        IConfig $config
39
    ) {
40
        $this->config = $config;
41
    }
42
43
    /**
44
     * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
45
     *
46
     * @since 9.1
47
     */
48
    public function getForm()
49
    {
50
        return new TemplateResponse(Application::APP_ID, 'admin', [
51
            'expire_days' => $this->config->getAppValue(Application::APP_ID, 'expire_days', 7),
52
        ], '');
53
    }
54
55
    /**
56
     * @return string the section ID, e.g. 'sharing'
57
     *
58
     * @since 9.1
59
     */
60
    public function getSection()
61
    {
62
        return Application::APP_ID;
63
    }
64
65
    /**
66
     * @return int whether the form should be rather on the top or bottom of
67
     *             the admin section. The forms are arranged in ascending order of the
68
     *             priority values. It is required to return a value between 0 and 100.
69
     *
70
     * E.g.: 70
71
     *
72
     * @since 9.1
73
     */
74
    public function getPriority()
75
    {
76
        return 1;
77
    }
78
}
79