Completed
Push — master ( 6d2df6...196bfd )
by Tõnis
02:08
created

Condition   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 21
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A getIsMet() 0 4 1
1
<?php
2
3
namespace dameter\abstracts\models;
4
5
use dameter\abstracts\validators\VariableNameValidator;
6
use dameter\abstracts\WithSurveyModel;
7
8
/**
9
 * Class Condition
10
 * @package dameter\abstracts\models
11
 * @author Tõnis Ormisson <[email protected]>
12
 *
13
 * @property integer $condition_id
14
 * @property string $name
15
 * @property string $rules
16
 * @property boolean $isMet whether the condition rules result in true
17
 */
18
class Condition extends WithSurveyModel
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function rules()
24
    {
25
        return array_merge(parent::rules(), [
26
            [['name', 'rules'], 'required'],
27
            [['name'], VariableNameValidator::class],
28
            [['rules'], 'string'],
29
        ]);
30
    }
31
32
    /**
33
     * @return bool
34
     */
35
    public function getIsMet()
36
    {
37
        // TODO
38
        return true;
39
    }
40
41
42
}