Completed
Push — master ( 188ba1...86d637 )
by Samuel
02:55
created

Validation::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 4
crap 2
1
<?php
2
3
namespace Kelemen\ApiNette\Validator;
4
5
class Validation
6
{
7
    private $type;
8
9
    private $key;
10
11
    private $rules;
12
13
    private $resultKey;
14
15 12
    public function __construct($type, $key, $rules, $resultKey = null)
16
    {
17 12
        $this->type = $type;
18 12
        $this->key = $key;
19 12
        $this->rules = $rules;
20 12
        $this->resultKey = $resultKey !== null ? $resultKey : $key;
21 12
    }
22
23 12
    public function getType()
24
    {
25 12
        return $this->type;
26
    }
27
28 12
    public function getKey()
29
    {
30 12
        return $this->key;
31
    }
32
33 12
    public function getRules()
34
    {
35 12
        return $this->rules;
36
    }
37
38
    public function getResultKey()
39
    {
40
        return $this->resultKey;
41
    }
42
}
43