Issues (23)

models/ConfigureForm.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace humhub\modules\Steam\models;
4
5
use Yii;
6
use yii\base\Model;
0 ignored issues
show
The type yii\base\Model 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...
7
8
/**
9
 * ConfigureForm defines the configurable fields.
10
11
 */
12
class ConfigureForm extends Model
13
{
14
15
    public $serverUrl;
16
17
    // Settings
18
    public $implement = ['System.Behaviors.SettingsModel'];
19
20
    // Settings field & Code
21
    public $settingsFields = 'settings/fields.yaml';
22
23
    public $settingsCode = 'humhub_Steam_system_settings';
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function rules()
29
    {
30
        return [
31
            ['serverUrl', 'string'],
32
        ];
33
    }
34
35
    /**
36
     * @inheritdoc
37
     */
38
    public function attributeLabels()
39
    {
40
        return [
41
            'serverUrl' => Yii::t('SteamModule.base', 'Steam Widget URL:'),
42
        ];
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function attributeHints()
49
    {
50
        return [
51
            'serverUrl' => Yii::t('SteamModule.base', 'e.g. http://store.steampowered.com/widget/{id}/{id}'),
52
        ];
53
    }
54
55
    public function loadSettings()
56
    {
57
        $this->serverUrl = Yii::$app->getModule('steam')->settings->get('serverUrl');
58
59
        return true;
60
    }
61
62
    public function save()
63
    {
64
        Yii::$app->getModule('steam')->settings->set('serverUrl', $this->serverUrl);
65
66
        return true;
67
    }
68
69
}
70