Settings::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
/**
3
 * Lever plugin for Craft CMS 3.x
4
 *
5
 * Craft + Lever.
6
 *
7
 * @link      https://workingconcept.com
8
 * @copyright Copyright (c) 2018 Working Concept Inc.
9
 */
10
11
namespace workingconcept\lever\models;
12
13
use workingconcept\lever\Lever;
14
15
use Craft;
16
use craft\base\Model;
17
18
class Settings extends Model
19
{
20
    /**
21
     * @var string Lever API key
22
     */
23
    public $apiKey = '';
24
25
    /**
26
     * @var string Lever site slug
27
     */
28
    public $site = '';
29
30
    /**
31
     * @var string Source value to be sent with every application from this site
32
     */
33
    public $applicationSource = 'Craft CMS';
34
35
    /**
36
     * @var bool Whether or not candidate should receive an email upon application
37
     */
38
    public $applySilently = true;
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function rules()
44
    {
45
        return [
46
            [['apiKey', 'site', 'applicationSource'], 'string'],
47
            [['applySilently'], 'boolean'],
48
            [['apiKey', 'site', 'applicationSource'], 'required'],
49
        ];
50
    }
51
52
}
53